magic-js icon indicating copy to clipboard operation
magic-js copied to clipboard

ES module import fails for @magic-ext/harmony in yarn PNP strict mode

Open klngrs opened this issue 2 years ago • 2 comments

✅ Prerequisites

  • [yes] Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • [yes] Are you running the latest SDK version?
  • [yes] Are you reporting to the correct repository (magic-sdk)?

🐛 Description

The following fails during compile: import { HarmonyExtension } from "@magic-ext/harmony";

🧩 Steps to Reproduce

  1. Create a regular webpack project
  2. Use yarn 3 in pnp strict mode
  3. Install @magic-ext/[email protected]
  4. Attempt to import it with import { HarmonyExtension } from "@magic-ext/harmony";

🤔 Expected behavior

The project should compile and import the harmony extension properly.

😮 Actual behavior

Error: "Module not found: Error: Can't resolve '@magic-ext/harmony' in ..." or "Package path ./dist/es/index.js is not exported from package /.yarn/cache/@magic-ext-harmony-npm-3.1.0-7d7316d909-47169ad610.zip/node_modules/@magic-ext/harmony/ (see exports field in..."

💻 Code Sample

N/A

🌎 Environment

Software Version(s)
@magic-ext/harmony 3.1.0
magic-sdk 8.0.1
Browser Brave
yarn 3.1.1
Operating System Mac

klngrs avatar Mar 22 '22 17:03 klngrs

Proposed PR for a fix: https://github.com/magiclabs/magic-js/pull/298

klngrs avatar Mar 22 '22 17:03 klngrs

@harryEth

Ethella avatar Apr 06 '22 18:04 Ethella