Skip to content

[Error 3.3.2] Components as variable = "error: __name is not defined" (TSX related) #8303

Closed
@arpowers

Description

@arpowers

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/[email protected]/node_modules/source-map-js/lib/quick-sort.js:2:848), <anonymous>:3:107)
      at cloneSort (/core/node_modules/.pnpm/[email protected]/node_modules/source-map-js/lib/quick-sort.js:112:10)
      at exports.quickSort (/core/node_modules/.pnpm/[email protected]/node_modules/source-map-js/lib/quick-sort.js:128:19)
      at BasicSourceMapConsumer.SourceMapConsumer_parseMappings (/core/node_modules/.pnpm/[email protected]/node_modules/source-map-js/lib/source-map-consumer.js:604:9)
      at BasicSourceMapConsumer.get (/core/node_modules/.pnpm/[email protected]/node_modules/source-map-js/lib/source-map-consumer.js:70:12)
      at BasicSourceMapConsumer.SourceMapConsumer_eachMapping (/core/node_modules/.pnpm/[email protected]/node_modules/source-map-js/lib/source-map-consumer.js:136:23)
      at mapLines (/core/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:3671:18)
      at doCompileTemplate (/core/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:3643:13)
      at Object.compileTemplate (/core/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:3586:12)
      at compile (file:///core/node_modules/.pnpm/@[email protected][email protected][email protected]/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions