react-three-next: Clean typescript install giving "Module parse failed: Octal literal in strict mode" when opening
- Platform: Windows 11
- Node Version: v19.6.1
- Installed using:
yarn create r3f-app next 3d-mapper -ts
On a clean install of react-three-next
and running npm run dev
I’m getting the following error:
Failed to Compile
./app/page.tsx
Module parse failed: Octal literal in strict mode (2:38)
| import { createProxy } from "next/dist/build/webpack/loaders/next-flight-loader/module-proxy"
> const proxy = createProxy("D:\code\web\3d-mapper\app\page.tsx")
|
| // Accessing the __esModule property and exporting $$typeof are required here.
Incidentally, I also had difficulty installing via the npx create-r3f-app next 3d-mapper tailwind -ts
command, getting the same problem as #120. I was able to get around this using this suggestion in #119 and then the yarn command, but in both cases, upon running the app, I get the above error.
I was able to create a new app via npx
about 3 weeks ago, so it’s probably one of the changes made since then.
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 17 (3 by maintainers)
OK, I think I may have found a solution to the
Uncaught SyntaxError: "undefined" is not valid JSON
problem. Looking for the error on nextjs’s issues, I came across vercel/next.js#47024), which suggested upgrading to the latest next canary release (currently v13.3.1-canary.7).npx create-r3f-app@1.6.7 next test2 -ts
works as expected (omitting the version still doesn’t work for me; IDK if something just hasn’t been synced yet)yarn add next@13.3.1-canary.7
(be careful withnpm i next@13.3.1-canary.7
sometimes it gives a dependency error)npm run dev
should work.Again, I will note that this only seems to be a problem on Windows not my Mac (though, the next.js issue was with darwin, so maybe it’s just non-macs? Who knows).
Thanks for the quick response, but whatever you did is causing other issues. 😢
First, running
npx create-r3f-app next my-app -ts
now opens a new cmd window that shows onlyWelcome. Project's generation started using create-R3F-App 🐱
then closes without doing anything.Running
npx create-r3f-app@1.6.7 next my-app -ts
opens a new window, downloads everything correctly, but installs the app to the root of the drive. Still workable though, but then testing what it did install gets me these errors:I tried running
npm i
to see if it forgot to install something, but that yielded the same results.I’m seeing this error as well in a fresh run of
yarn create r3f-app next my-app
. Node versionv19.7.0
in powershell.Edit: this resolved the issue. I blame powershell 😅
I also have this issue.
You can debug this by cloning https://github.com/utsuboco/create-r3f-app and running the binary directly. For example:
./bin/create-r3f-app next my-app -ts
OK, so the new window thing was probably just a thing on my end. That went away after closing and reopening the terminal, but
npx
still isn’t working.Still also getting the “Failed to Compile” error with
yarn
installs. I’ll try this tomorrow on my Mac and see if anything changes.