I am trying to run npm run tauri build on Windows but for some reason it's building a .next file. This is fine during development as when running npm run tauri dev it doesn't matter. You just get an error but it doesn't stop the application from actually running. This is different for when I run the build command. I have my next.config setup with output: 'export' and I've even tried changing the package.json to have next build && next export along with tauri.config.js to have npm run build && npm run export. Please help 😭
#npm run tauri build not working
5 messages · Page 1 of 1 (latest)
You are probabaly missing something in the setup, make sure you follow the steps properly on the website, I've built 3 apps using the latest nextjs version and nextjs has also worked in the beta for me as well, so you have done something wrong probabaly.
This project was fully finished and was building at some point as far as I know I didn't do anything wrong
Here's the package.json
"name": "projectcraft",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"tauri": "tauri"
},
"dependencies": {
"@fortawesome/free-brands-svg-icons": "^6.4.2",
"@fortawesome/pro-light-svg-icons": "^6.4.2",
"@fortawesome/pro-regular-svg-icons": "^6.4.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18",
"@tauri-apps/api": "^1.5.1",
"autoprefixer": "10.4.15",
"axios": "^1.5.0",
"eslint": "8.47.0",
"eslint-config-next": "13.4.17",
"next": "^13.5.6",
"postcss": "^8.4.31",
"react": "18.2.0",
"react-dom": "18.2.0",
"swr": "^2.2.2",
"tailwindcss": "3.3.3"
},
"devDependencies": {
"@tauri-apps/cli": "^1.5.6"
}
}
next.config.js
const nextConfig = {
output: "export",
}
module.exports = nextConfig
and tauri.config.json
{
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
"build": {
"beforeBuildCommand": "npm run build",
"beforeDevCommand": "npm run dev",
"devPath": "http://localhost:3000",
"distDir": "../out"
},
@inland gyro I believe I debugged the issue. "use client" on the root page.js with app router seems to be causing the issue