npm run dev : SyntaxError: Unexpected token 'export'
Hello guys,
i just installed a fresh version of filament v2 with table editor, but i get error SyntaxError: Unexpected token 'export'
here the full error :
ERROR in ./resources/css/app.css
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
/var/www/hired/postcss.config.js:1
export default {
^^^^^^
SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1126:15)
at Module._compile (node:internal/modules/cjs/loader:1162:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
at Function.Module._load (node:internal/modules/cjs/loader:911:12)
at Module.require (node:internal/modules/cjs/loader:1100:19)
at module.exports (/var/www/hired/node_modules/import-fresh/index.js:32:59)
at loadJs (/var/www/hired/node_modules/cosmiconfig/dist/loaders.js:16:18)
at Explorer.loadFileContent (/var/www/hired/node_modules/cosmiconfig/dist/Explorer.js:84:32)
at processResult (/var/www/hired/node_modules/webpack/lib/NormalModule.js:764:19)
at /var/www/hired/node_modules/webpack/lib/NormalModule.js:866:5
at /var/www/hired/node_modules/loader-runner/lib/LoaderRunner.js:400:11
at /var/www/hired/node_modules/loader-runner/lib/LoaderRunner.js:252:18
at context.callback (/var/www/hired/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
at Object.loader (/var/www/hired/node_modules/postcss-loader/dist/index.js:56:7)
1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
the error is about loading esm into cjs as i understood, but something seem strange me is happend on fresh new installation, btw i used node 16
does anyone have met this issue ?
Best
1 Reply
So i found the issue by myself, Btw i migrate from mix to vite and now everything good