tvicpe / nl2br-pipe Goto Github PK
View Code? Open in Web Editor NEWangular2+ pipe to transform new line character to <br />
angular2+ pipe to transform new line character to <br />
With angular 14 build, it will show the following:
The package available on NPM does not seems to contains the UMD packaged module (dist/bundles/nl2br-pipe-module.umd.js
).
This make JEST fails to import the module correctly and all unit test fails.
Hi,
unfortunately, it's not possible to compile an app with Angular 5 (via angular-cli), including this module.
I get the following error message when I try to compile with 'ng serve':
ERROR in ./node_modules/nl2br-pipe/src/nl2br.pipe.ts
Module build failed: Error: /path/to/project/node_modules/nl2br-pipe/src/nl2br.pipe.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (/path/to/project/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:677:23)
at plugin.done.then (/path/to/project/node_modules/@ngtools/webpack/src/loader.js:467:39)
at process._tickCallback (internal/process/next_tick.js:109:7)
You can read about this issue e.g. here: angular/angular-cli#8284
Especially this part gives the hint on the issue: "You have TS files in your node_modules. This really goes against how libraries should be packaged: libraries should never ship their source .ts files."
angular/angular-cli#8284 (comment)
The only (very ugly) way to solve this problem was to add this to the tsconfig.app.json of my app:
"include": [ "../node_modules/nl2br-pipe/**/*.ts", "**/*.ts" ],
Kind regards
Andi
When importing the module as specified I get an error.
ERROR in Error: Metadata version mismatch for module .../node_modules/nl2br-pipe/index.d.ts,
found version 4, expected 3, resolving symbol AppModule in .../app/app.module.ts,
resolving symbol AppModule in .../app/app.module.ts
Using:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.