I'm having trouble building my Svelte Kit project with SMUI. I'm getting the error message "Unexpected token (Note that you need plugins to import files that are not JavaScript)". I've followed the instructions to install the rollup-plugin-node-resolve plugin, but I'm still getting the error.
I've attached the output of the npm run build command. Can anyone help me figure out what's going on?
Thanks in advance!
Here the output (I have cutted out not-related stuff like filepaths etc):
[email protected] build
vite build
(!) Experimental legacy.buildSsrCjsExternalHeuristics and ssr.format: 'cjs' are going to be removed in Vite 5.
Find more information and give feedback at https://github.com/vitejs/vite/discussions/13816.
vite v4.4.9 building SSR bundle for production...
transforming (123) node_modules/@smui/list/dist/Label.svelte
✓ 235 modules transformed.
(!) Experimental legacy.buildSsrCjsExternalHeuristics and ssr.format: 'cjs' are going to be removed in Vite 5.
Find more information and give feedback at https://github.com/vitejs/vite/discussions/13816.
vite v4.4.9 building for production...
transforming (116) node_modules/@smui/drawer/dist/index.js
✓ 241 modules transformed.
✓ built in 3.89s
Using @sveltejs/adapter-node
error during build:
RollupError: Unexpect
ed token (Note that you need plugins to import files that are not JavaScript)
I am trying to build my Svelte Kit project, but I am getting the following error:
RollupError: Unexpected token (Note that you need plugins to import files that are not JavaScript) I have tried the following:
I have installed the rollup-plugin-node-resolve plugin. I have added the plugin to my rollup.config.js file. I have rebuilt my project. I am expecting the build to succeed without any errors.
Also here is my dependencies:
"devDependencies": {
"@floating-ui/dom": "^1.5.1",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-typescript": "^11.1.3",
"@smui-extra/badge": "^7.0.0-beta.14",
"@smui-extra/bottom-app-bar": "^7.0.0-beta.14",
"@smui/button": "^7.0.0-beta.14",
"@smui/card": "^7.0.0-beta.14",
"@smui/checkbox": "^7.0.0-beta.14",
"@smui/drawer": "^7.0.0-beta.14",
"@smui/form-field": "^7.0.0-beta.14",
"@smui/icon-button": "^7.0.0-beta.14",
"@smui/layout-grid": "^7.0.0-beta.14",
"@smui/list": "^7.0.0-beta.14",
"@smui/menu": "^7.0.0-beta.14",
"@smui/segmented-button": "^7.0.0-beta.14",
"@smui/tooltip": "^7.0.0-beta.14",
"@smui/top-app-bar": "^7.0.0-beta.14",
"@sveltejs/adapter-node": "^1.3.1",
"@tailwindcss/forms": "^0.5.4",
"@tailwindcss/typography": "^0.5.9",
"@tsconfig/svelte": "^5.0.2",
"autoprefixer": "^10.4.15",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-svelte": "^2.32.4",
"highlight.js": "^11.8.0",
"postcss": "^8.4.28",
"prettier": "^3.0.2",
"prettier-plugin-svelte": "^3.0.3",
"sass": "^1.66.0",
"svelte": "^4.2.0",
"svelte-adapter-appengine": "^0.10.3",
"svelte-avatar": "^1.2.0",
"svelte-check": "^3.5.0",
"svelte-fa": "^3.0.4",
"tailwindcss": "^3.3.3",
"typescript": "^5.1.6"
},
"type": "module",
"dependencies": {
"@fortawesome/free-brands-svg-icons": "^6.4.2",
"@fortawesome/free-regular-svg-icons": "^6.4.2",
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@material/dom": "^14.0.0",
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/kit": "^1.5.0",
"gridjs": "^6.0.6",
"gridjs-svelte": "^2.1.1",
"jquery": "^3.7.1",
"svelte-material-ui": "^7.0.0-beta.14",
"vite": "^4.3.0"
}