Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when starting dev server: TypeError: (0 , import_vite_plugin.crx) is not a function #939

Open
1 of 2 tasks
twicer-is-coder opened this issue Oct 26, 2024 · 12 comments

Comments

@twicer-is-coder
Copy link

twicer-is-coder commented Oct 26, 2024

Build tool

Rollup

Where do you see the problem?

  • In the browser
  • In the terminal

Describe the bug

Everything was working fine until chrome released 130 and caused chaos with CSP. However I have upgraded the CRXJS package to "@crxjs/vite-plugin": "^2.0.0-beta.26" which have a fix for it. When I am starting the vite dev server, I am getting this error:

failed to load config from XX\vite.config.ts
Error when starting dev server:
TypeError: (0 , import_vite_plugin.crx) is not a functions

Any advise or workaround? I need to ship it ASAP as my extension is not working on production for many users.

Reproduction

Install ver 2.0.0-beta.26 and npm run dev.

Logs

No response

System Info

Windows 11, Chrome 130

Severity

blocking all usage of RPCE

@jacksteamdev
Copy link
Contributor

@twicer-is-coder This looks like an import error in your config file, but it's hard to tell without more background.

  1. Can you provide your config file as a minimum repro?
  2. What was your last CRXJS version?

@promethyttrium
Copy link

add "type": "module" to your package.json

@abdullah-tsx
Copy link

was facing the same issue.
fixed it by updating following
"@crxjs/vite-plugin": "^2.0.0-beta.28"
"vite": "5.4.6"

@Nantris
Copy link

Nantris commented Nov 8, 2024

None of these solutions make a difference. crxjs seems unusable at this time.

The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
failed to load config from redacted/packages/extension/vite.config.js
error when starting dev server:
TypeError: (0 , import_vite_plugin.crx) is not a function

@rahulbansal16
Copy link

How did you resolve this? @Nantris

@Nantris
Copy link

Nantris commented Nov 18, 2024

I didn't. I moved to WXT.

@rahulbansal16
Copy link

I don't have bandwidth to change the framework for my project. My project is running on Keep The Light Mode on.

@Nantris
Copy link

Nantris commented Nov 22, 2024

Ah yeah, sorry - I had just started out. There's no version you can roll back to and removing node_modules doesn't work I guess?

@rahulbansal16
Copy link

There are changes in the chrome browser which requires new changes #928 It started happening after I downloaded the new version.

@ayalpani
Copy link

Can confirm. Same error, same versions

"@crxjs/vite-plugin": "^2.0.0-beta.28",
"vite": "^5.4.6"

@ayalpani
Copy link

@rahulbansal16 Did you find a solution?

@ayalpani
Copy link

ayalpani commented Dec 3, 2024

Hi @jacksteamdev !

Thanks for this amazing library, I have been using it successfully for a year now. Unfortunately now I am stuck and can not do any new releases. Can you give me a quick hint: will this be resolved any time soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants