Compiling Angular code with nats.ws as dependency fails
See original GitHub issueHi there,
first of all, thank you for your work. This repo helped us a lot.
Currently, we are using an older version of nats.ws, and when trying to update to nats.ws 1.0.0-117, we encounter a few compilation errors, such as:
Error: ./node_modules/nats.ws/nats.mjs 1070:22
Module parse failed: Unexpected token (1070:22)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| this._off = 0;
| }
> _tryGrowByReslice = (n)=>{
| const l = this._buf.byteLength;
| if (n <= this.capacity - l) {
@ ./src/app/app.component.ts 2:0-34 40:8-15
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi ./src/main.ts
This is a log from trying to compile this example repo I set up, but it’s the same log in our main application.
The example repo uses Angular 11, we currently use Angular 10.
If I follow the errors and fix them, the code works, but this is not a good solution because we would need to copy the code from the dependency into our own repository and keep making the same modifications for all upcoming updates.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:16 (12 by maintainers)
Top Results From Across the Web
nats.ws - npm
nats.ws is an async nats client. The model a standard ES Module. Copy the nats.js module from node_modules (if you didn't build it...
Read more >Typescript NATS | NATS blog - NATS.io
With TypeScript we can write better JavaScript: Tooling helps us write correct code; refactoring code is possible and safer, and compiler ...
Read more >Identify and Fix Build and Deployment Errors in Your Angular ...
In this guide, you will learn how to spot some of the most common build and deployment errors and how to resolve them...
Read more >Module not found: Error: Can't resolve 'util' in webpack
Ejecting the entire Angular build system just to fix a dependency is insane. – Askdesigners. May 23, 2022 at 7:49. I don' ...
Read more >Compare Packages Between Distributions - DistroWatch.com
Algorithm-Dependency 1.112.0. Algorithm-Diff 1.201.0 ... Apache-LogFormat-Compiler 0.360.0 apache-mode 2.2.0 ... kdsoap-ws-discovery-client 0.2_pre20200927
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
Hi @aricart, could you perhaps release a new version of this lib?
It compiles now, but it’s still awkward to consume.
To the Angular users:
If you are using Jest for testing, you will run into another rabbit hole because of *.mjs. For now, I solves this by adding a
nats.mock.ts
file somewhere, with the content:with usage in a test suite:
and the addition to jest.config.js: