You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[antd, mantine] Content script ui compiled error when using UI components #703
As long as in the content script ui (Such as: entrypoints/example-ui.content/App.tsx), reference to the component of the three-party component library antd, the compilation error will be reported, in the configuration of vite, sourcemap off still failed to compile; This is normal in popup or other newtab pages
Sorry, no idea what is going on. Reproduction is good. There aren't sourcemaps provided by antd, so I'm not sure why Vite is attempting to load them, nor what the original error is.
If someone else wants to debug this, feel free. I don't have time right now.
Also seeing this with mantine, see the new react-mantine example. Seems related to something in the react ecosystem... Not seeing anything like this with other frameworks.
Also seeing this with mantine, see the new react-mantine example. Seems related to something in the react ecosystem... Not seeing anything like this with other frameworks.
yeah, The issue at hand is causing significant frustration, to the extent that I had to switch the component library. Even when attempting to block error information in the configuration file, it seems like it may impact compilation speed. It is my hope that someone can provide a solution for this matter.
Discovered something maybe relevant here today? If you add a package to vite's ssr.noExternal array, it can cause similar logs. Not an exact match, but wanted to share here:
✔ Started dev server @ http://localhost:3000 5:33:48 PM
ℹ Pre-rendering chrome-mv3 for development with Vite 5.3.1 5:33:48 PM
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/htmlparser2/lib/esm/index.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/css-select/lib/esm/index.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/htmlparser2/lib/esm/Parser.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/domutils/lib/esm/index.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/htmlparser2/lib/esm/Tokenizer.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/css-select/lib/esm/pseudo-selectors/index.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/css-select/lib/esm/pseudo-selectors/subselects.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/css-select/lib/esm/compile.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/entities/lib/esm/decode.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/domutils/lib/esm/querying.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/domutils/lib/esm/stringify.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/domutils/lib/esm/legacy.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/domutils/lib/esm/manipulation.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/domutils/lib/esm/traversal.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/domutils/lib/esm/helpers.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/domutils/lib/esm/feeds.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/css-select/lib/esm/pseudo-selectors/filters.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/css-select/lib/esm/pseudo-selectors/aliases.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/css-select/lib/esm/sort.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/entities/lib/esm/generated/decode-data-xml.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/css-select/lib/esm/general.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/entities/lib/esm/decode_codepoint.js" points to missing source files
Sourcemap for "/Users/aklinker1/Development/github.com/aklinker1/github-better-line-counts/node_modules/.pnpm/[email protected]/node_modules/entities/lib/esm/generated/decode-data-html.js" points to missing source files
...
There was about 4x as many logs as I've shown above, truncated it for clarity.
changed the title [-]content script ui compiled error when using UI components[/-][+][antd, mantine] Content script ui compiled error when using UI components[/+]on Jul 6, 2024
I also encountered this issue before. The conclusion is that it's a problem with Vite (Rollup), not WXT. The issue arises because the presence of directives (like use client;) in React components isn't accounted for, causing the generated sourcemap lines to be misaligned.
Activity
hussion commentedon Jun 5, 2024
@aklinker1 Do you have time to take a look?
aklinker1 commentedon Jun 8, 2024
Sorry, no idea what is going on. Reproduction is good. There aren't sourcemaps provided by antd, so I'm not sure why Vite is attempting to load them, nor what the original error is.
If someone else wants to debug this, feel free. I don't have time right now.
aklinker1 commentedon Jun 17, 2024
Also seeing this with mantine, see the new
react-mantineexample. Seems related to something in the react ecosystem... Not seeing anything like this with other frameworks.hussion commentedon Jun 20, 2024
yeah, The issue at hand is causing significant frustration, to the extent that I had to switch the component library. Even when attempting to block error information in the configuration file, it seems like it may impact compilation speed. It is my hope that someone can provide a solution for this matter.
aklinker1 commentedon Jun 20, 2024
Discovered something maybe relevant here today? If you add a package to vite's
ssr.noExternalarray, it can cause similar logs. Not an exact match, but wanted to share here:// wxt.config.ts vite: () => ({ plugins: [Icons({ compiler: "vue3" }), Vue()], + ssr: { + noExternal: [/.*/], + }, }),There was about 4x as many logs as I've shown above, truncated it for clarity.
hussion commentedon Jun 21, 2024
@aklinker1 may be the same issue : vite issue, You see if it helps.
[-]content script ui compiled error when using UI components[/-][+][antd, mantine] Content script ui compiled error when using UI components[/+]1natsu172 commentedon Jul 28, 2024
@hussion
I also encountered this issue before. The conclusion is that it's a problem with Vite (Rollup), not WXT. The issue arises because the presence of directives (like use client;) in React components isn't accounted for, causing the generated sourcemap lines to be misaligned.
While many people in the thread ignore the warning, I found that broken sourcemaps cause issues, so I've been using the https://github.com/huozhi/rollup-preserve-directives solution from that answer as a workaround.
However, using this plugin can significantly increase build times and degrade performance. 🙃
1natsu172 commentedon Sep 29, 2024
The vite team seems to have decided to ignore the warning vitejs/vite-plugin-react#369. Next release of
vite-plugin-reactwill have no warnings.aklinker1 commentedon Sep 30, 2024
Gonna close this then! Thanks for finding that @1natsu172