-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: console.Console is not a constructor #151
Comments
I'm using a Node-only API there, but there's a browser-fallback too, which doesn't seem to get used for some reason. How do you run the code in the browser? Browserify should pick it up, but webpack might not... As for data.format('bibliography', {template: 'chicago'}) Apart from that, the Cite.CSL.register.addTemplate('chicago', xml) The xml is available here: https://github.com/citation-style-language/styles |
I am running a React app via npm with react-scripts, which uses webpack. I installed citation-js via npm, but did nothing else special (I do note the "Browser releases" in the instructions, but am unclear if that applies in this situation). And thanks for the info on chicago style! |
No, if you want to use webpack, those instructions don't really apply. I can fix this particular issue (sometime soon, not right now), but webpack might have other problems, for example with babel config. I'll have to see about that later. Perhaps distributing a browser file, with or without dependencies, on npm would work. |
Remove the use of the 'browser' field in package.json for files about logging, as webpack doesn't support it in the same way that browserify does. Fix #151
I published |
Not sure if this is Stupid User Error, a bug in citation-js, or a bug in one of its dependencies, but when I use citation-js in a React app from the browser, I get the error 'TypeError: console.Console is not a constructor' at node_modules/citation-js/lib/logger.js:10.
My code:
(Note: I do not know if citation-chicago is an actual format, but appear to not get that far in processing anyway).
Anything I am missing?
The text was updated successfully, but these errors were encountered: