@pupeno haven’t had that particular issue but I’d have to guess you might need to use a different file?
@martinklepsch what do you man by a different file?
@pupeno it sounds as if maybe the file you specified as file
/`file-min` isn’t intended for in-browser usage
(I’m purely speculating but that would be what I’d check)
I'm not sure what to check. The library is for use in the browser and I can use it in my ClojureScript app if I include it directly, but it's messy, so, I want to package it with cljsjs
> I can use it in my ClojureScript app if I include it directly Are you certain that the file you use in that case is the same file that you know bundled with CLJSJS?
@martinklepsch well, no. The file is compiled by webpack separately in my app and in the cljsjs but the webpack config is as similar as I could generate it.
Seems likely that there is a difference in configuration (webpack) that’s causing the error
@martinklepsch I added the working webpack.config here: http://stackoverflow.com/questions/41905042/webpack-babel-react-react-transform-hmr
Don’t know anything about webpack unfortunately
Oh... ok 😞
@pupeno npm run build
runs gulp -> babel and configuration in react-toolbox uses that react-transform-hmr transformation: https://github.com/react-toolbox/react-toolbox/blob/dev/.babelrc#L8
perhaps that somehow conflicts with Cljs
Mhhh… I think I tried with and without it.... let me see.
That transformation is only enabled in development mode (`process.NODE_ENV`) so if you other project is using production
or something, it wouldn't be using that
juhoteperi well… I’m not even sure what’s the state of NODE_ENV in a cljs project.
You were running webpack?
I have a project with a webpack but I’m trying to remove that as the only reason to have that was react-toolbox that I’m trying to pack.
By the way, doing npm install --production, had a completely different outcome (different error)
So, running or not npm build makes not difference, I get the same error.
You probably need to run the npm build, but did you tryin running it with NODE_ENV=production
set?
No… I’m not sure how to do that in boot. Do you know?
((sh "NODE_ENV=production" "npm" "run" "build"))
Or you can also just set in in webpack config: https://github.com/cljsjs/packages/blob/a486e6af0389a1d2754e3a21e7772f082b208815/react-highlight/resources/webpack.config.js#L2
ok… rebuilding.
That seems to have made the error go away. Awesome! thanks @juhoteperi
Yes, that is possible. You should define React as "external" or something in the webpack config
Yes, I have it as external.
I defined a couple more externals:
But it doesn’t seem to be working as expected:
What am I missing here?