Issues with @pollyjs
See original GitHub issueI’m not well versed in embroider and not sure if this is an issue with embroider or polly. Trying to run tests with pollyjs installed fails because it can not find @pollyjs/core
Error: Could not find module `@pollyjs/core` imported from `(require)`
at missingModule (http://localhost:7357/assets/vendor.js:256:11)
at findModule (http://localhost:7357/assets/vendor.js:267:7)
at requireModule (http://localhost:7357/assets/vendor.js:33:15)
at eval (webpack:///../externals/@pollyjs/core.js?:1:18)
at Object.../externals/@pollyjs/core.js (http://localhost:7357/assets/chunk.1b5c9874276dfbdc23d0.js:165:1)
at __webpack_require__ (http://localhost:7357/assets/chunk.1b5c9874276dfbdc23d0.js:80:30)
at eval (webpack:///./tests/acceptance/index-test.js?:5:139)
at Module../tests/acceptance/index-test.js (http://localhost:7357/assets/chunk.1b5c9874276dfbdc23d0.js:188:1)
at __webpack_require__ (http://localhost:7357/assets/chunk.1b5c9874276dfbdc23d0.js:80:30)
at Module.eval [as callback] (webpack:///./assets/test.js?:193:10)
I have reproduced this issue here: https://github.com/Mciocca/polly-embroider-example
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Issues · Netflix/pollyjs - GitHub
Record, Replay, and Stub HTTP Interactions. Contribute to Netflix/pollyjs development by creating an account on GitHub. ... Dependency issue with url-parse.
Read more >@pollyjs/core - npm Package Health Analysis | Snyk
Is @pollyjs/core safe to use? The npm package @pollyjs/core was scanned for known vulnerabilities and missing license, and no issues were found. Thus...
Read more >@pollyjs/core - npm
Polly.JS is a standalone, framework-agnostic JavaScript library that enables recording, replaying, and stubbing of HTTP interactions.
Read more >Integration tests in Angular using PollyJS | by Jonathan Harrison
This caused issues for the app under test as certain functionality isn't implemented (accessing snapshot and firstchild properties). A workaround is to use ......
Read more >Newest 'pollyjs' Questions - Stack Overflow
I'm having a strange issue with PolyJS and Jest. ... I use pollyjs with the persister-rest to record some requests to easily test...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That makes sense to me. We can move the other @pollyjs dependencies as peer deps under the @pollyjs/ember package and update the documentation accordingly.
@Mciocca, thanks for sharing the reproduction. That app fails because it’s trying to do something illegal: it’s trying to import
@pollyjs/core
from within the app’s own test suite, but the app doesn’t depend directly on@pollyjs/core
.You cannot access your dependency’s dependencies. In a classic build, all dependencies are flattened into one namespace, which causes a lot of correctness problems. Embroider doesn’t do that, and each package gets its own dependencies.
If
@pollyjs/ember
intends to make@pollyjs/core
available to apps, it should list@pollyjs/core
as a peerDependency instead of a dependency and make apps depend directly on it.Alternatively,
@pollyjs/ember
could reexport the things from@pollyjs/core
that people will need, and apps should import them from@pollyjs/ember
.