Replies: 1 comment
-
Hi Roberto! The error message Vite uses native ESM. Although it can in some cases transpile dependencies written in CJS, it expects most code that you are using to be ESM. In ESM, instead of: // Declare KTApp for Webpack support
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = KTApp;
} you would do: export default KTApp Otherwise, the file is not a JS module, and as the error mentions: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everybody, I'm starting a new project and I'm trying Vite with Rails 7.
To bootstrap my project I need an admin theme and I'm trying to integrate a bootstrap based theme, Metronic.
I have an entry point for this theme, init.js
This is the entrypoint of my admin theme, served by Vite.
Here the first error:
Uncaught SyntaxError: The requested module '/vite-dev/admin/vendor/metronic/components/init.js?t=1668182014104' does not provide an export named 'default'
If I try with
import '~/admin/vendor/metronic/components/init'
This is a simplified version of file KTApp
I have every file in the theme with this structure and I cannot understand how to solve this...
Beta Was this translation helpful? Give feedback.
All reactions