create nuxt app project and use the spa mode,
1.yarn build
2.yarn start
3.yarn dev
Can work fine when switch both yarn build and yarn dev

Note: yarn dev ==> yarn build is fine, but yarn build ==> yarn dev, will build error
After the build error happen, I need to remove the node_mould folder, especially need to yarn cache clean thenyarn install again, after that, yarn dev work back.
Hi @Quineone. I think you are using nuxt with programmatic usage with manual importing of nuxt config. In that case, you need to use esm. Sharing a reproduction or at least package.json (scripts) would be appreciated.
Hi @pi0, have the same issue. Here's the repo
https://github.com/MontolioV/test-nuxt-dev-build-bug
It's just a clean setup with create-nuxt-app:
create-nuxt-app v3.1.0
✨ Generating Nuxt.js project in test-nuxt-dev-build-bug
? Project name: test-nuxt-dev-build-bug
? Programming language: TypeScript
? Package manager: Npm
? UI framework: None
? Nuxt.js modules: (Press <space> to select, <a> to toggle all, <i> to invert selection)
? Linting tools: (Press <space> to select, <a> to toggle all, <i> to invert selection)
? Testing framework: None
? Rendering mode: Universal (SSR / SSG)
? Deployment target: Server (Node.js hosting)
? Development tools: (Press <space> to select, <a> to toggle all, <i> to invert selection)
Problem is the same.
SyntaxError: Unexpected token 'export'https://codesandbox.io/s/github/MontolioV/test-nuxt-dev-build-bug - works fine, no syntax error
What you describe doesn't make any sense as it seems like a something weird with your files/node
@aldarund hi! Possibly. I decided to describe it, as I saw the issue with the similar problem.
Just checked on other machine: Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-1065-aws x86_64), node -v 13.12.0, cloned https://github.com/MontolioV/test-nuxt-dev-build-bug. The same behavior as I described.
Also checked Windows 10 Version 10.0.18363 Build 18363, node -v 14.6.0 and 12.18.2 - same behavior.

OK, reproduced. It happens because you do build with nuxt-ts and than run dev with nuxt ( without ts). config is cached when its build with nuxt-ts and when u run it without ts it result in syntax error. Use either nuxt for everything or nuxt-ts
hi @aaronransley , thank you very much, it work. So will you update this to cli on further version?
It is actually fixed in CNA already, just not released https://github.com/nuxt/create-nuxt-app/pull/568
closing this. To fix this issue manually just change dev command from nuxt to nuxt-ts
Most helpful comment
OK, reproduced. It happens because you do build with nuxt-ts and than run dev with nuxt ( without ts). config is cached when its build with nuxt-ts and when u run it without ts it result in syntax error. Use either nuxt for everything or nuxt-ts