Comments (7)
Hi @schlichtanders thanks for reporting this issue. Reejs had removed support for Deno polyfill a few versions ago, due to unintended side affects.
To intentionally enable deno support, please add --deno
parameter at the end of your reejs command.
(Since you're using npx, there's need of addititonal "--" before that parameter, in order to pass the additional parameter to reejs cli)
I currently tried that and then the deno polyfills loads up, but fails with the following error:
INFO Saving important data...
ReferenceError: __dirname is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '/data/data/com.termux/files/usr/lib/node_modules/reejs/.reejs/cache/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at https://esm.sh/v135/@deno/[email protected]/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):109:13666
at https://esm.sh/v135/@deno/[email protected]/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):109:458
at https://esm.sh/v135/@deno/[email protected]/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):110:3076
at https://esm.sh/v135/@deno/[email protected]/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):109:458
at https://esm.sh/v135/@deno/[email protected]/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):110:4066
at https://esm.sh/v135/@deno/[email protected]/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):109:458
at https://esm.sh/v135/@deno/[email protected]/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):110:59466
at https://esm.sh/v135/@deno/[email protected]/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):109:458
at https://esm.sh/v135/@deno/[email protected]/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):110:68331
at https://esm.sh/v135/@deno/[email protected]/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):109:458
I'll be debugging more of it later.
from esm.sh.
In case the cli cannot be installed on
npm
, it would be great to update the central website documentation to reflect this
Esm.sh's original service is to serve url imports, and is not a cli focused tool. The cli you see on deno & reejs - esm.sh only manages the importmaps file, but the underlying URL imports work is done by deno & reejs themselves.
You might want to look at jspm if you have problems running either of these two.
from esm.sh.
FYI, in v136 the CLI script will be deprecated, instead a vscode extension will be released for import map updating(support index.html/importmap.json/deno.json)
from esm.sh.
Here's my personal notice that explains this new error, I've already encountered it before:
__dirname
is defined in cjs, but not in mjs/esm.
esm.sh currently still cannot polyfill/fix this.
From my end/Reejs' end - it tries to polyfill __dirname at the start of each file where necessary. However I either disabled that support 2 months ago (that's when I last updated reejs) or reejs failed to polyfill __dirname
from its side too.
from esm.sh.
I don't want to use deno
, but want to use npm
- hence I don't have deno
installed
from esm.sh.
In case the cli cannot be installed on npm
, it would be great to update the central website documentation to reflect this
from esm.sh.
You might want to look at jspm if you have problems running either of these two.
My research already pointed me to jspm (took some time to find it). Thank you for the pointer, it really solves the cli part for import maps and also supports esm.sh
from esm.sh.
Related Issues (20)
- No space left on device HOT 1
- Mechanism logic update for managing files HOT 2
- Failed to import - https://esm.sh/@adobe/[email protected]?external=react,react-dom,mobx,mobx-react,@react-spectrum/provider,@react-spectrum/theme-default,@babel/runtime&bundle
- Failed to import - @privy-io/react-auth
- Failed to import bcrypt HOT 2
- Failed to import jsx-runtime HOT 2
- Failed to import - react@rc in development mode HOT 4
- esbuild target: User-Agent not working HOT 4
- Failed to import - @mendable/firecrawl-js
- Failed to import @vercel/og
- `esm.sh` is likey to fail to load the latest version of JSR packages
- Deploy v136? HOT 1
- The "deps" query parameter is not honored fully deep
- Whitelisting broken? - Failed to import - @sentry/astro HOT 3
- Failed to import - web-vitals HOT 1
- Failed to import "@!!!!!/elemental"
- Failed to import some react libraries
- Failed to import - types HOT 5
- Type resolution failure: @types/culori
- 'localStorage' issue with "esm" function.
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 esm.sh.