Giter Club home page Giter Club logo

Comments (7)

renhiyama avatar renhiyama commented on May 27, 2024 1

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.

renhiyama avatar renhiyama commented on May 27, 2024 1

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.

ije avatar ije commented on May 27, 2024 1

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)

image

from esm.sh.

renhiyama avatar renhiyama commented on May 27, 2024

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.

schlichtanders avatar schlichtanders commented on May 27, 2024

I don't want to use deno, but want to use npm - hence I don't have deno installed

from esm.sh.

schlichtanders avatar schlichtanders commented on May 27, 2024

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.

schlichtanders avatar schlichtanders commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.