codesandbox / sandpack

A component toolkit for creating live-running code editing experiences, using the power of CodeSandbox.
https://sandpack.codesandbox.io
Apache License 2.0
4.77k stars 336 forks source link

Using nextjs app dir inside of sandpack #955

Open benjaminshafii opened 1 year ago

benjaminshafii commented 1 year ago

Bug report

Packages affected

Description of the problem

I am trying to use Sandpack with Next.js and set up the app directory inside the template. Specifically, I want to modify the Next.js template to reflect the app directory file structure and use it in my custom setup.

What were you doing when the problem occurred?

I was trying to modify the Next.js template used by Sandpack to reflect the app directory file structure.

What steps can we take to reproduce the problem?

  1. Modify the Next.js template used by Sandpack to reflect the app directory file structure.
  2. Use the modified template in the custom setup of Sandpack.
  3. Run Sandpack with the modified template and observe the problem.

Link to sandbox:

Interestingly the sandbox link loads correctly https://codesandbox.io/p/sandbox/lq7kpr?utm_medium=sandpack&file=%2Fapp%2Fpage.js%3A1%2C1

Your Environment

Software Name/Version
Sandpack-react version ^2.6.7
Browser Chrome 113.0.5672.126 (Official Build) (arm64)
Operating System macos13.3.1 (22E261)

Screenshots

Instatiation of sandpack image

Modified NEXTJS template

image

Error message image

ochmanski commented 10 months ago

any news? did you manage to get it working?

ochmanski commented 10 months ago

Screenshot 2023-12-03 at 19 19 54

getting this error with next 13.5.6 and @next/swc-wasm-nodejs 13.5.6

xiaomuxi commented 7 months ago

any updates?

cameronking4 commented 5 months ago

Same issue