turso-extended / app-turso-nextjs-starter

A Next.js starter template that uses Turso to store data and Tailwindcss for styling.
https://turso-nextjs-starter.vercel.app
MIT License
22 stars 6 forks source link

Local dev and build failing #2

Closed kellenproctor closed 1 year ago

kellenproctor commented 1 year ago

I'm here because I'm having an issue using createClient in my own app, which is separate but related to this issue.

I cloned this repository, followed the instructions to create a turso db, and added the URL and AuthKey to a .env.local file.

Running pnpm install then pnpm dev generates the following error:

- error node:https
Module build failed: UnhandledSchemeError: Reading from "node:https" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
Import trace for requested module:
node:https
./node_modules/.pnpm/@libsql+isomorphic-fetch@0.1.6/node_modules/@libsql/isomorphic-fetch/node.mjs
./node_modules/.pnpm/@libsql+client@0.1.6/node_modules/@libsql/client/lib-esm/http.js
./utils/tursoClient.ts
./app/page.tsx
./node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/build/webpack/loaders/next-app-loader.js?name=app%2Fpage&page=%2Fpage&appPaths=%2Fpage&pagePath=private-next-app-dir%2Fpage.tsx&appDir=%2Fhome%2Fdiana%2Fapps%2Fapp-turso-nextjs-starter%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2Fhome%2Fdiana%2Fapps%2Fapp-turso-nextjs-starter&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=!./app/page.tsx?__edge_ssr_entry__

Running pnpm build generates the following error:

Failed to compile.

node:https
Module build failed: UnhandledSchemeError: Reading from "node:https" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
    at /home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:395974
    at Hook.eval [as callAsync] (eval at create (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:13:28771), <anonymous>:6:1)
    at Object.processResource (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:395899)
    at processResource (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:5308)
    at iteratePitchingLoaders (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:4667)
    at runLoaders (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:8590)
    at NormalModule._doBuild (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:395761)
    at NormalModule.build (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:397789)
    at /home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:81243
    at NormalModule.needBuild (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:401902)

Import trace for requested module:
node:https
./node_modules/.pnpm/@libsql+isomorphic-fetch@0.1.6/node_modules/@libsql/isomorphic-fetch/node.mjs
./node_modules/.pnpm/@libsql+client@0.1.6/node_modules/@libsql/client/lib-esm/http.js
./utils/tursoClient.ts
./app/api/add-framework/route.ts
./node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/build/webpack/loaders/next-app-loader.js?name=app%2Fapi%2Fadd-framework%2Froute&page=%2Fapi%2Fadd-framework%2Froute&pagePath=private-next-app-dir%2Fapi%2Fadd-framework%2Froute.ts&appDir=%2Fhome%2Fdiana%2Fapps%2Fapp-turso-nextjs-starter%2Fapp&appPaths=%2Fapi%2Fadd-framework%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=!./app/api/add-framework/route.ts?__edge_ssr_entry__

node:http
Module build failed: UnhandledSchemeError: Reading from "node:http" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
    at /home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:395974
    at Hook.eval [as callAsync] (eval at create (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:13:28771), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:13:25925)
    at Object.processResource (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:395899)
    at processResource (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:5308)
    at iteratePitchingLoaders (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:4667)
    at runLoaders (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:8590)
    at NormalModule._doBuild (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:395761)
    at NormalModule.build (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:397789)
    at /home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:81243

Import trace for requested module:
node:http
./node_modules/.pnpm/@libsql+isomorphic-fetch@0.1.6/node_modules/@libsql/isomorphic-fetch/node.mjs
./node_modules/.pnpm/@libsql+client@0.1.6/node_modules/@libsql/client/lib-esm/http.js
./utils/tursoClient.ts
./app/api/add-framework/route.ts
./node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/build/webpack/loaders/next-app-loader.js?name=app%2Fapi%2Fadd-framework%2Froute&page=%2Fapi%2Fadd-framework%2Froute&pagePath=private-next-app-dir%2Fapi%2Fadd-framework%2Froute.ts&appDir=%2Fhome%2Fdiana%2Fapps%2Fapp-turso-nextjs-starter%2Fapp&appPaths=%2Fapi%2Fadd-framework%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=!./app/api/add-framework/route.ts?__edge_ssr_entry__

node:stream
Module build failed: UnhandledSchemeError: Reading from "node:stream" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
    at /home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:395974
    at Hook.eval [as callAsync] (eval at create (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:13:28771), <anonymous>:6:1)
    at Object.processResource (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:395899)
    at processResource (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:5308)
    at iteratePitchingLoaders (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:4667)
    at runLoaders (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:8590)
    at NormalModule._doBuild (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:395761)
    at NormalModule.build (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:397789)
    at /home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:81243
    at NormalModule.needBuild (/home/diana/apps/app-turso-nextjs-starter/node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:401902)

Import trace for requested module:
node:stream
./node_modules/.pnpm/@libsql+isomorphic-fetch@0.1.6/node_modules/@libsql/isomorphic-fetch/node.mjs
./node_modules/.pnpm/@libsql+client@0.1.6/node_modules/@libsql/client/lib-esm/http.js
./utils/tursoClient.ts
./app/api/add-framework/route.ts
./node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/build/webpack/loaders/next-app-loader.js?name=app%2Fapi%2Fadd-framework%2Froute&page=%2Fapi%2Fadd-framework%2Froute&pagePath=private-next-app-dir%2Fapi%2Fadd-framework%2Froute.ts&appDir=%2Fhome%2Fdiana%2Fapps%2Fapp-turso-nextjs-starter%2Fapp&appPaths=%2Fapi%2Fadd-framework%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=!./app/api/add-framework/route.ts?__edge_ssr_entry__

> Build failed because of webpack errors
- info Creating an optimized production build . ELIFECYCLE  Command failed with exit code 1.

Any idea what the issues are?

xinnks commented 1 year ago

@kellenproctor This issue has been resolved in https://github.com/turso-extended/app-turso-nextjs-starter/commit/74565e1be1f67cff966320f8e377d9f4254a9024