Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESBuild is unable to include package #43

Closed
tranzium opened this issue Nov 12, 2021 · 1 comment
Closed

ESBuild is unable to include package #43

tranzium opened this issue Nov 12, 2021 · 1 comment
Labels
needs more info I'm not sure how to help with the provided information

Comments

@tranzium
Copy link

I am unable to determine what is causing my build to fail now that I have required this package.

npm run build.src

const esb = require("esbuild")
esb.build({
  bundle: true,
  entryPoints: [
    "./src/index.ts",
  ],
  format: "esm",
  outdir: "./dist/",
  outExtension: {
    ".js": ".mjs",
  },
  platform: "neutral",
  sourcemap: true,
})
node build.src.js

> src/oauth2/server.ts:1:48: error: Could not resolve "@jmondi/oauth2-server" (mark it as external to exclude it from the bundle)
    1 ¦ import { AuthorizationServer, JwtService } from "@jmondi/oauth2-server";
      ?                                                  ~~~~~~~~~~~~~~~~~~~~~

Build error Error: Build failed with 1 error:
src/oauth2/server.ts:1:48: error: Could not resolve "@jmondi/oauth2-server" (mark it as external to exclude it from the bundle)
    at failureErrorWithLog (D:\projects\project\node_modules\esbuild\lib\main.js:1475:15)
    at D:\projects\project\node_modules\esbuild\lib\main.js:1133:28
    at runOnEndCallbacks (D:\projects\project\node_modules\esbuild\lib\main.js:1051:65)
    at buildResponseToResult (D:\projects\project\node_modules\esbuild\lib\main.js:1131:7)
    at D:\projects\project\node_modules\esbuild\lib\main.js:1240:14
    at D:\projects\project\node_modules\esbuild\lib\main.js:611:9
    at handleIncomingPacket (D:\projects\project\node_modules\esbuild\lib\main.js:708:9)
    at Socket.readFromStdout (D:\projects\project\node_modules\esbuild\lib\main.js:578:7)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)
@jasonraimondi
Copy link
Owner

jasonraimondi commented Nov 13, 2021

Sorry, while I have heard/seen it, I am not super familiar with esbuild. If you are able to put up a sample repository, I can try and take a look.

@jasonraimondi jasonraimondi added question Further information is requested needs more info I'm not sure how to help with the provided information and removed question Further information is requested labels Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info I'm not sure how to help with the provided information
Projects
None yet
Development

No branches or pull requests

2 participants