core: [Error 3.3.2] Components as variable = "error: __name is not defined" (TSX related)
Vue version
3.3.2
Steps to reproduce
This issue was introduced with latest Vue, so is a breaking change if intentional.
When importing a component into a TS file and passing to another object:
import MyComponent from './MyComponent.vue'
// later
const myObject = new SomeClass({el: MyComponent})
Using latest vite/vue this now creates the error:
11:03:31 AM [vite] Internal server error: __name is not defined
Plugin: vite:vue
File: /www/src/pages/ElLogo.vue
at SortTemplate (eval at cloneSort (/core/node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/quick-sort.js:2:848), <anonymous>:3:107)
at cloneSort (/core/node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/quick-sort.js:112:10)
at exports.quickSort (/core/node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/quick-sort.js:128:19)
at BasicSourceMapConsumer.SourceMapConsumer_parseMappings (/core/node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/source-map-consumer.js:604:9)
at BasicSourceMapConsumer.get (/core/node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/source-map-consumer.js:70:12)
at BasicSourceMapConsumer.SourceMapConsumer_eachMapping (/core/node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/source-map-consumer.js:136:23)
at mapLines (/core/node_modules/.pnpm/@vue+compiler-sfc@3.3.2/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:3671:18)
at doCompileTemplate (/core/node_modules/.pnpm/@vue+compiler-sfc@3.3.2/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:3643:13)
at Object.compileTemplate (/core/node_modules/.pnpm/@vue+compiler-sfc@3.3.2/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:3586:12)
at compile (file:///core/node_modules/.pnpm/@vitejs+plugin-vue@4.2.3_vite@4.3.5_vue@3.3.2/node_modules/@vitejs/plugin-vue/dist/index.mjs:163:35)
__name is not defined
System Info
Node 18.6, Mac
Any additional comments?
Hoping for a quick resolution to this issue, if there is a debate about this or problem with reproduction, i will create one.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 5
- Comments: 19 (9 by maintainers)
@arpowers temp solution:
Add this line in top of
vite.config.mtsor some of other your code before run vite@xiaoxiangmoe @arpowers Have you solved it? I also encountered this problem, In CICD. local is OK.
https://github.com/lixiaofa/fast-plus/actions/runs/5443372337/jobs/9900013548