blomqma / next-rest-framework

Type-safe, self-documenting APIs for Next.js
https://next-rest-framework.vercel.app
Other
134 stars 17 forks source link

esbuild errors #157

Closed seanconnollydev closed 4 months ago

seanconnollydev commented 4 months ago

I tried walking through the getting started guide and ran into immediate esbuild errors when running npx next-rest-framework generate.

Error: Build failed with 9 errors:
node_modules/@swc/core/index.js:70:35: ERROR: Could not resolve "@swc/wasm"
node_modules/cpu-features/lib/index.js:3:24: ERROR: No loader is configured for ".node" files: node_modules/cpu-features/build/Release/cpufeatures.node
node_modules/enhanced-resolve/lib/ResolverFactory.js:129:17: ERROR: Could not resolve "pnpapi"
node_modules/fsevents/fsevents.js:13:23: ERROR: No loader is configured for ".node" files: node_modules/fsevents/fsevents.node
node_modules/next/dist/compiled/@vercel/og/index.edge.js:18563:23: ERROR: No loader is configured for ".wasm" files: node_modules/next/dist/compiled/@vercel/og/resvg.wasm?module

My project matches all listed requirements. Node v18.17.0 Next.js v13.4.19 (using app router) Typescript v5.1.6 Zod v3.22.4

markedwards commented 4 months ago

I see a bunch of WARNING messages like the following:

Compiling endpoints...
▲ [WARNING] "../package.json" should be marked as external for use with "require.resolve" [require-resolve-not-external]

    ../../node_modules/playwright/lib/index.js:59:64:
      59 │ (0, _utils.addInternalStackPrefix)(path.dirname(require.resolve('../package.json')));

This is in a yarn monorepo (yarn v1 workspaces).

The docs seem to generate okay, but the warnings are quite ugly.

Edit: I think this is a distinct issue so I opened #158

blomqma commented 4 months ago

This should be now addressed in v6.0.0-beta.4, please let me know if your issue persists after upgrading.