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 versions available for esm-node-services HOT 9
- "esmLexer: invalid syntax, require javascript/typescript" on valid file HOT 5
- Not possible to import a React client component in Next.JS via esm.sh
- Use custom node polyfill via `alias` and `external` query
- @observablehq/plot prototypes are missing a method due to skipped side effects
- Support GitHub Gists
- Failed to import - d3 HOT 1
- Support importing modules from jsr.io HOT 1
- how to get react profiling version
- Failed to import - basehub/react - shows 500 Internal Server Error. - on commit
- Failed to import - @mui/material HOT 6
- Failed to import - openlayers
- All previously built urls are failing HOT 1
- Question: why don't you use yarn pnp
- Self hosted - 405 Response using the npm.pkg.github.com registry HOT 3
- Wrong `x-typescript-types` for `@babel/parser`
- Failed to import - @headlessui/react HOT 3
- Failed to import - [email protected] (previous version works) HOT 3
- Problem with using Monaco with ESM HOT 2
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.