codesandbox-client icon indicating copy to clipboard operation
codesandbox-client copied to clipboard

When importing @emotion/core package editor treats it as a relative dependency and throws an error

Open maciekmaciej opened this issue 7 years ago • 7 comments

🐛 bug report

Description of the problem

How has this issue affected you? What are you trying to accomplish?

I want to use packages that names start with @ sign. When importing namespaced npm package (e.g. @emotion/core) editor treats it as a relative dependency and throws an error:

Could not find module in path: '@emotion/core' relative to '/src/index.js'

Link to sandbox: link

maciekmaciej avatar Jan 30 '19 10:01 maciekmaciej

I'm currently looking into this one. I don't think it's treated as a relative dependency, but @emotion has some redirects in its browsers field that don't get followed properly.

Other @ dependencies should still work.

CompuIves avatar Jan 30 '19 10:01 CompuIves

Okey, thank you! My bad, I'll change the title...

maciekmaciej avatar Jan 30 '19 10:01 maciekmaciej

Found the issue! It seems like unpkg has no CORS headers for the new @emotion version, so we're not able to fetch missing files. We will use jsdelivr in the meantime. The fix should be live in 10 min.

CompuIves avatar Jan 30 '19 10:01 CompuIves

@CompuIves Amazing! Thank you 🎉

maciekmaciej avatar Jan 30 '19 10:01 maciekmaciej

@CompuIves, unfortunately, it breaks the support of packages larger than 50Mb...

BingoRUS avatar Jan 30 '19 17:01 BingoRUS

This issue is back again 😢 ModuleNotFoundError: Could not find module in path: '@emotion/core' relative to '/node_modules/@emotion/styled-base/dist/styled-base.browser.cjs.js'

unbiased-dev avatar Feb 04 '19 10:02 unbiased-dev

I'm deploying now a fallback system, where we first try one service and if it fails we use the other one.

CompuIves avatar Feb 04 '19 10:02 CompuIves