2

I am trying to install Jetstream in a Laravel project. Immediately after running the command php artisan jetstream:install livewire, this error appears:

`C:\xampp\htdocs\PFE\PFE\postcss.config.js:1
export default {
SyntaxError: Unexpected token 'export'
    at internalCompileFunction (node:internal/vm:76:18)
    at wrapSafe (node:internal/modules/cjs/loader:1283:20)
    at Module._compile (node:internal/modules/cjs/loader:1328:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:203:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
    at async importDefault (file:///C:/xampp/htdocs/PFE/PFE/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:36556:18)`

I updated Node.js to the latest version (v18.20.2), but the error still occurs. I hope that Laravel will work for me with Jetstream or Breeze normally and well. What can I do to resolve this issue?

1 Answer 1

3

Please make sure you have "type" : "module" in your package.json file.

Sign up to request clarification or add additional context in comments.

2 Comments

The package.json file contains { "private": true, "scripts": { "dev": "vite", "build": "vite build" }, "devDependencies": { "@tailwindcss/forms": "^0.5.2", "@tailwindcss/typography": "^0.5.0", "autoprefixer": "^10.4.7", "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "postcss": "^8.4.14", "tailwindcss": "^3.1.0", "vite": "^4.0.0" } }
it should be this then : { "private": true, "scripts": { "dev": "vite", "build": "vite build" }, "devDependencies": { "@tailwindcss/forms": "^0.5.2", "@tailwindcss/typography": "^0.5.0", "autoprefixer": "^10.4.7", "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "postcss": "^8.4.14", "tailwindcss": "^3.1.0", "vite": "^4.0.0" }, "type": "module" }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.