Giter VIP home page Giter VIP logo

Comments (7)

heineiuo avatar heineiuo commented on July 3, 2024

@rlee1990 Can you provide a simple repo to present this error?

from isomorphic-ws.

rlee1990 avatar rlee1990 commented on July 3, 2024

@heineiuo there is no repo because it won't compile. You can just type ram.sh/ the package name in the web browser and you will see the error

from isomorphic-ws.

heineiuo avatar heineiuo commented on July 3, 2024

It looks like esm.sh does not respect peerDependencies or there maybe some arguments to support peerDependencies.

from isomorphic-ws.

rlee1990 avatar rlee1990 commented on July 3, 2024

It looks like esm.sh does not respect peerDependencies or there maybe some arguments to support peerDependencies.

Any way to get around this or to get it all working?

from isomorphic-ws.

rlee1990 avatar rlee1990 commented on July 3, 2024

Any update @heineiuo

from isomorphic-ws.

JoCat avatar JoCat commented on July 3, 2024

apparently due to the fact that the library does not have an exported file for esm and an error occurs

from isomorphic-ws.

monsterbitar avatar monsterbitar commented on July 3, 2024

To address this problem:

  1. create an ESM compatible version node.mjs file:
"use strict";

export * from 'ws';
  1. Update the package.json file to replace:
  "browser": "browser.js",

with:

  "exports": {
    "browser": "./browser.js",
    "import": "./node.mjs",
    "require": "./node.js"
  },

then add the new node.mjs file in the "files" section.

from isomorphic-ws.

Related Issues (18)

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.