Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Next JS 13 not creating export

Tags:

next.js

Running next build on "next": "^13.2.4" does not produce the "export" folder in ".next"

output: 'export' set in next.config.js

Running next build on the canary version produces "export" folder, but with a plethora of errors SyntaxError: Unexpected token u in JSON at position 0. JSON nor parse is not being used throughout the project at all.

Using App folder structure.

EDIT

next export is depriacted in favor of output: 'export'. Running it throws: "PageNotFoundError: Cannot find module for page:"

Any ideas for either of the versions would be greatly appreciated.

EDIT2

The problem seems to be with the command "use client" as removing it seems to solve the issue in some cases. Additionally, NextJS apparently fixed this issue in the latest release of canary, but Your experience may vary

like image 791
thewb Avatar asked Sep 15 '26 12:09

thewb


1 Answers

The bug was fixed in the newest versions of NextJS

like image 62
thewb Avatar answered Sep 18 '26 13:09

thewb