plasmicapp / plasmic

Visual builder for React. Build apps, websites, and content. Integrate with your codebase.
https://www.plasmic.app
MIT License
4.69k stars 377 forks source link

Support Next.js edge runtime #98

Open ryscheng opened 7 months ago

ryscheng commented 7 months ago

Using Next.js 14 app dir, rendering a single page on the edge runtime

Reference: https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes

Gets the following error

   ▲ Next.js 14.0.3
   - Environments: .env.local

   Creating an optimized production build ...
Failed to compile.

../node_modules/.pnpm/@plasmicapp+loader-nextjs@1.0.302_next@14.0.3_react-dom@18.2.0_react@18.2.0/node_modules/@plasmicapp/loader-nextjs/dist/index.js:110:26
Module not found: Can't resolve 'path'

https://nextjs.org/docs/messages/module-not-found

../node_modules/.pnpm/@plasmicapp+loader-nextjs@1.0.302_next@14.0.3_react-dom@18.2.0_react@18.2.0/node_modules/@plasmicapp/loader-nextjs/dist/react-server.js:77:26
Module not found: Can't resolve 'path'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./plasmic-init.ts
./app/project/[...slug]/page.tsx
../node_modules/.pnpm/next@14.0.3_@babel+core@7.22.10_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/build/webpack/loaders/next-edge-ssr-loader/index.js?{"absolute500Path":"","absoluteAppPath":"next/dist/pages/_app","absoluteDocumentPath":"next/dist/pages/_document","absoluteErrorPath":"next/dist/pages/_error","absolutePagePath":"private-next-app-dir/project/[...slug]/page.tsx","buildId":"iZRoI2VTnhx1czVnpd36h","dev":false,"isServerComponent":true,"page":"/project/[...slug]/page",
roshanjonah commented 1 month ago

+1