Comments (6)
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 nodeModulesDir: true
. Not 100% if this is meant to be a public api or not, since it's not mentioned on the README, and it creates a node_modules dir in your project, but does seem to work. Probably portable
works as well?
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",
});
from esbuild_deno_loader.
@bpevs I just tried that fix with nodeModulesDir: true
and seems to have helped my most recent issue
from esbuild_deno_loader.
Note that nodeModulesDir: true
will not work on Deno Deploy https://github.com/lucacasonato/esbuild_deno_loader#limitations
from esbuild_deno_loader.
This should be fixed by #104
from esbuild_deno_loader.
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)
...
✘ [ERROR] NPM package not found. [plugin deno-loader]
../../../../../../.deno/deno_esbuild/@solid-primitives/[email protected][email protected]/node_modules/@solid-primitives/refs/dist/index.js:1:35:
1 │ import { chain, arrayEquals } from '@solid-primitives/utils';
...
error: Uncaught Error: Build failed with 17 errors:
...
from esbuild_deno_loader.
fix works for me on v0.8.4! Thanks!
from esbuild_deno_loader.
Related Issues (20)
- [ERROR] File name too long HOT 2
- Bug: Failing to treeshake dead imports of sub files that have node type imports in them HOT 2
- Error when importing JSR packages with jsr specifiers: "Importing a JSR package via an HTTPS URL is not implemented."
- Allow Remote Config File
- Top-level await is disallowed in service workers. HOT 2
- Could not resolve react in "@react-three/drei" using deno-loader
- Loader doesn't work with esbuild's stdio option HOT 3
- Preact support
- Unable to build with `npm:*` dependencies HOT 2
- Read permission is always required even with the portable loader
- Renaming temp folder errors on Github Actions HOT 5
- [ERROR] Directory not empty (os error 39) on build in docker HOT 2
- imports map not working HOT 2
- [plugin deno-loader] Module not found - preact/hook HOT 1
- Using with Deno Deploy HOT 2
- Relative path are not loaded HOT 1
- Module parse failure make the file unwatchable
- Document minimum deno version this works with HOT 1
- npm deps, with dependencies on node libraries are not handled properly HOT 1
- importmap support local path HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esbuild_deno_loader.