Open tcstory opened 1 year ago
https://github.com/tcstory/vue3-demo-esm-bug
no error is reported on terminal
you will see the following error. but if you remove the style tag from the index.html, the problem will be solved.
style
1 SyntaxError: Unexpected token (2:15) 2 at Parser.pp$4.raise (file:///home/xxxx/Desktop/vue3-demo-esm-bug/node_modules/vite/dist/node/chunks/dep-ca21228b.js:18300:13) 3 at Parser.pp$9.unexpected (file:///home/xxxx/Desktop/vue3-demo-esm-bug/node_modules/vite/dist/node/chunks/dep-ca21228b.js:15601:8) 4 at Parser.pp$9.semicolon (file:///home/xxxx/Desktop/vue3-demo-esm-bug/node_modules/vite/dist/node/chunks/dep-ca21228b.js:15578:66) 5 at Parser.pp$8.parseExpressionStatement (file:///home/xxxx/Desktop/vue3-demo-esm-bug/node_modules/vite/dist/node/chunks/dep-ca21228b.js:16061:8) 6 at Parser.pp$8.parseStatement (file:///home/xxxx/Desktop/vue3-demo-esm-bug/node_modules/vite/dist/node/chunks/dep-ca21228b.js:15794:24) 7 at Parser.pp$8.parseTopLevel (file:///home/xxxx/Desktop/vue3-demo-esm-bug/node_modules/vite/dist/node/chunks/dep-ca21228b.js:15658:21) 8 at Parser.parse (file:///home/xxxx/Desktop/vue3-demo-esm-bug/node_modules/vite/dist/node/chunks/dep-ca21228b.js:15430:15) 9 at Function.parse (file:///home/xxxx/Desktop/vue3-demo-esm-bug/node_modules/vite/dist/node/chunks/dep-ca21228b.js:15480:35) 10 at TransformContext.parse (file:///home/xxxx/Desktop/vue3-demo-esm-bug/node_modules/vite/dist/node/chunks/dep-ca21228b.js:41350:27) 11 at TransformContext.transform (/home/xxxx/Desktop/vue3-demo-esm-bug/node_modules/@originjs/vite-plugin-federation/dist/index.js:1180:20) { 12 pos: 16, 13 loc: Position { line: 2, column: 15 }, 14 raisedAt: 17 15 }
It seems that the error is caused by the ast conversion of some not js related files.
Versions
Reproduction
https://github.com/tcstory/vue3-demo-esm-bug
Steps to reproduce
What is Expected?
no error is reported on terminal
What is actually happening?
you will see the following error. but if you remove the
style
tag from the index.html, the problem will be solved.