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

I get a compile error when using vite-ssg #20

Open
ghost opened this issue Dec 27, 2022 · 2 comments
Open

I get a compile error when using vite-ssg #20

ghost opened this issue Dec 27, 2022 · 2 comments

Comments

@ghost
Copy link

ghost commented Dec 27, 2022

[Vue Router warn]: uncaught error during route navigation:
file:///Users/nn/Work/mf-products/.vite-ssg-temp/assets/index-df334bb5.js:15
import { StripeElements, StripeElement } from "vue-stripe-js";
                         ^^^^^^^^^^^^^
SyntaxError: Named export 'StripeElement' not found. The requested module 'vue-stripe-js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'vue-stripe-js';
const { StripeElements, StripeElement } = pkg;

Can you please take a look at this and let me know what's the work-around until fixed?

@ghost
Copy link
Author

ghost commented Dec 27, 2022

Update, what worked for me, but unfortunately can't do this for prod is following:

  • Update your package.json to have "type": "module"

@timramseyjr
Copy link

I am having the same issue using vite ssr. @nenadnovakovic-sh did you ever figure out a solution?

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

1 participant