Closed aitmamatovmusa closed 10 months ago
I'm having the same problem, in @crxjs/vite-plugin/dist/index.mjs
if I change const asset = bundle[key];
to const asset = bundle[key] || bundle[`.vite/${key}`];
it starts to work, it seems that the "bundle" variable don't have a key named "manifest.json", in my case the options are:
[
'assets/main.tsx-4SQhfq8G.js',
'assets/crx-manifest.js-DzEZuLEe.js',
'assets/index.html-djdEtln7.js',
'assets/background.ts-pqoZZU2H.js',
'assets/client-H9Qj9e3E.js',
'assets/main.tsx-loader-g6xFzHuK.js',
'index.html',
'.vite/manifest.json',
'service-worker-loader.js'
]
I started to use this lib today and I don't know sufficient about it to try to do a PR for this myself
Should I use it in my manifest file?
[
'assets/main.tsx-4SQhfq8G.js',
'assets/crx-manifest.js-DzEZuLEe.js',
'assets/index.html-djdEtln7.js',
'assets/background.ts-pqoZZU2H.js',
'assets/client-H9Qj9e3E.js',
'assets/main.tsx-loader-g6xFzHuK.js',
'index.html',
'.vite/manifest.json',
'service-worker-loader.js'
]
this is just me showing the bundle variable to help the person that'll help us. Temporarily I did the const asset = bundle[key] || bundle[`.vite/${key}`];
and it worked
Running into the same issue as well. I confirmed @PauloMesquitaSP 's fix worked for me as well:
I'm having the same problem, in
@crxjs/vite-plugin/dist/index.mjs
if I changeconst asset = bundle[key];
toconst asset = bundle[key] || bundle[`.vite/${key}`];
it starts to work, it seems that the "bundle" variable don't have a key named "manifest.json", in my case the options are:[ 'assets/main.tsx-4SQhfq8G.js', 'assets/crx-manifest.js-DzEZuLEe.js', 'assets/index.html-djdEtln7.js', 'assets/background.ts-pqoZZU2H.js', 'assets/client-H9Qj9e3E.js', 'assets/main.tsx-loader-g6xFzHuK.js', 'index.html', '.vite/manifest.json', 'service-worker-loader.js' ]
I started to use this lib today and I don't know sufficient about it to try to do a PR for this myself
Amazing, this worked for me
Unfortunately, I'm with @PauloMesquitaSP when it comes to making a PR. I don't have enough background to feel comfortable posting a PR. Why is manifest.json
as a key being found in the bundle as .vite/manifest.json
? ¯_(ツ)_/¯
I'm thinking this issue is a showstopper for using the tool.
Actually this issuse is caused by updating vite to v5, this tool does not currently support v5.
Actually this issuse is caused by updating vite to v5, this tool does not currently support v5.
Thank you for that info, @mubaidr . I confirmed that downgrading to vite v4.5.0 solved the issue.
Anyone know of plans to support vite v5? :-)
Stumbled on this today with Vite 5: they introduced a .vite
directory where the manifest.json file is stored. They have a section about that in the migration docs for v5: https://vitejs.dev/guide/migration#manifest-files-are-now-generated-in-vite-directory-by-default
My error is fixed too!
node_modules/@crxjs/vite-plugin/dist/index.mjs
// const asset = bundle[key]; //this code makes error!
const asset = bundle[key] || bundle[`.vite/${key}`]; // nice code!!
I realize again the importance of checking errors. Thank you very much!
The fix suggested by @PauloMesquitaSP works, any chance we can include this to the lib to avoid having to fork it?
I'm pickin the maintainers are on holiday. I guess we just wait patiently!
bump
Build tool
Vite
Where do you see the problem?
Describe the bug
There are errors when i build (
npm run build
) related to manifest.json if i removecontent.jsx
fromcontent_scripts
everything works fine.Reproduction
https://github.com/aytmamatov/crxjs-example
Logs
System Info
Severity
blocking all usage of RPCE