-
Notifications
You must be signed in to change notification settings - Fork 46
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
NPM specifier libs not working #81
Comments
I'm also seeing this behavior! thrown from this line: https://github.com/lucacasonato/esbuild_deno_loader/blob/main/src/loader_native.ts#L161 import { build } from "npm:esbuild";
import { solidPlugin } from "npm:esbuild-plugin-solid";
import { denoPlugins } from "https://deno.land/x/[email protected]/mod.ts";
import { resolve } from 'https://deno.land/[email protected]/path/mod.ts';
const importMapURL = new URL('file://' + resolve('./import_map.json'))
const [denoResolver, denoLoader] = [...denoPlugins({ importMapURL })];
const result = await build({
entryPoints: ["./source/index.tsx"],
outfile: "./public/index.js",
bundle: true,
format: "esm",
treeShaking: true,
minify: true,
plugins: [
denoResolver,
solidPlugin({ solid: { moduleName: 'npm:solid-js/web' } }),
denoLoader
],
}); import { render } from "solid-js/web"
import { Motion } from "npm:@motionone/solid";
function App() {
return <Motion>Hello world</Motion>
}
render(() => <App />, document.body)
|
FYI @jordandobrev it looks like this only happens with the deno global cache node_modules? As a workaround, I'm finding that this error seems to go away if using the But for your example, this might work: const result = await esbuild.build({
plugins: [...denoPlugins({ nodeModulesDir: true })],
entryPoints: [`${source}/handler.ts`],
outfile: `${dist_folder}/handler-bundle.js`,
bundle: true,
format: "esm",
}); |
@bpevs I just tried that fix with |
Note that |
This should be fixed by #104 |
fix works for me on v0.8.4! Thanks! |
Hey 👋
Tried bundling one of my aws lambda projects and I'm getting errors when trying to do it:
my deps.ts
my bundle.ts
This resunts in over 30+ errors:
Any ideas how I can sort this out?
The text was updated successfully, but these errors were encountered: