Open jonlong opened 9 years ago
Not sure referencing the source files here is the correct answer. Have you tried the non-minified version of the dist/ file?
I've tried requiring the non-minified dist file and it does not solve the problem. However, if you run browserify with the standalone option, then it does bundle a valid CommonJS module that you can import. Not sure if this would break the browser version though.
Great feedback, thanks. Before merging, let me do a bit of testing and see if there are any unforeseen consequences of this change.
Hi, is the current version on NPM usable as a browserified module ?
I can't require()
it in my browserified app (like in #57, everything is undefined). The thing is, I can't require from node_modues/src
either, as the module does not bundle source? Not sure what i'm doing wrong :-)
@pandaiolo It's not fixed here. You can fork my fork for the time being and install directly from github (npm install pandaiolo/firebase-util
). I've been using that with browserify with no issues. All I've done in my fork is apply @jonlong's fix and merge with upstream.
Perfect, can do my import { Scroll as FBscroll } from 'firebase-util';
now :+1:
Thanks @ginovva320
I ran into the same issue described in https://github.com/firebase/firebase-util/issues/57, which seems to stem from NPM using the built files in
dist
rather than the raw files insrc
.I'm using Webpack to compile my CommonJS assets, and it throws the following error when including the built file in
dist
:This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
A minor update in package.json seems to point it in the right direction.