Comments (16)
Also getting this error when building with webpack.
It's only a warning, but still annoying that it gets in the way:
WARNING in ./node_modules/sax/lib/sax.js
Module not found: Error: Can't resolve 'stream' in '/home/f.wiles/Documents/soa/node_modules/sax/lib'
from xml-js.
Hello, I just installed xml-js and I am getting this error in console... Is there any update in how to permanently fix it?
Using Angular 8.0
from xml-js.
Hello, I just installed xml-js and I am getting this error in console... Is there any update in how to permanently fix it?
Using Angular 8.0
See: https://stackoverflow.com/a/55788098/4604351
from xml-js.
Yes, it's a known issue. Please read #54
from xml-js.
is that possible that this error causes this: Buffer is not defined
at Object.push../node_modules/xml-js/lib/json2xml.js.module.exports [as json2xml] (json2xml.js:4)
at AppComponent.push../src/app/app.component.ts.AppComponent.registerUser
?
from xml-js.
I think no. IMO there must be an error in your code. What's inside your app.component.ts
, in registerUser
method?
from xml-js.
Try to replace your console.log into console.log(xml)
.
The second thing, firstly you're changing js into xml (js2xml
) and then you want to map json to xml (json2xml
) using created previously xml
. json
!== xml
so probably that's your answer
from xml-js.
My latest post was wrong in all options. What is wrong in this? (the same error):
registerUser(form: NgForm) {
let xml = JSON.stringify(form.value);
console.log(xmljs.json2xml(xml, {compact: true, spaces: 4}));
}
from xml-js.
Please don't delete your comments. It can help others with similar issues
from xml-js.
Anyway, I've tried to reproduce your issue and I have the same error:
Buffer is not defined
at push../node_modules/xml-js/lib/json2xml.js.module.exports
from xml-js.
Is there another way when it works with Angular?
from xml-js.
There you can find that Buffer
is internal Node.js
one.
For your case, don't create json from js object, rather parse js object to xml directly:
registerUser(form: NgForm) {
console.log(xmljs.js2xml(form.value, {compact: true, spaces: 4}))
}
from xml-js.
Same here!
from xml-js.
I don't understand how #54 is related, but maybe i'm missing context from deleted comments.
Is there a way to get rid of this warning? And, if it is something that can't be resolving isn't there a risk that something will break?
from xml-js.
I am also having problems using xml-js with angular 6. I am getting the same error:
ReferenceError: Buffer is not defined
at Object.push../node_modules/xml-js/lib/json2xml.js.module.exports [as json2xml] (json2xml.js:4)
from xml-js.
Same for me, I use xmljs.js2xml
in Angular 7 and got
WARNING in ./node_modules/sax/lib/sax.js
Module not found: Error: Can't resolve 'stream' in 'path\to\nodeModules\node_modules\sax\lib'
UPDATE:
I was able to "remove" the WARNING by changing in sax.js the require('stream')
with require('readable-stream')
is there any permanent solution to this issue?
from xml-js.
Related Issues (20)
- "'" being changed to single quote HOT 2
- How to traverse through every tag
- `attributeNameFn` callback receives an undefined attributeValue
- CRLF line endings cause scripts failures HOT 1
- _attributes gets added to _attributes?
- Empty String of nativeTypeAttributes converted zero HOT 3
- Removing all _cdata _attributes text
- XML-JS Empty xml files being made after conversion from .json file HOT 1
- Typescript: `_comment` does not accept string[]
- attributes escape character?
- Consider type "string" as a default for all the values
- Analysis: 100% of dependency updates in this repository can be merged. HOT 1
- XML > JSON: How do I 'intercept' processing of a specific node?
- JSON -> XML convert with CDATA support
- json to xml: Auto convert < to <
- return parsed object instead of string ? HOT 1
- No nativeTypeAttributes in index.d.ts
- Assignment I was given,kindly give me both the XML code to build the app interface and the java code to execute it
- Module not found: Error: Can't resolve 'buffer'
- xml-js trims off the spaces in the text following each other
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xml-js.