Fork me on GitHub
#cljsjs
<
2017-01-28
>
martinklepsch05:01:41

@pupeno haven’t had that particular issue but I’d have to guess you might need to use a different file?

Pablo Fernandez13:01:28

@martinklepsch what do you man by a different file?

martinklepsch14:01:21

@pupeno it sounds as if maybe the file you specified as file/`file-min` isn’t intended for in-browser usage

martinklepsch14:01:33

(I’m purely speculating but that would be what I’d check)

Pablo Fernandez14:01:39

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

martinklepsch14:01:55

> 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?

Pablo Fernandez14:01:36

@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.

martinklepsch14:01:52

Seems likely that there is a difference in configuration (webpack) that’s causing the error

martinklepsch14:01:59

Don’t know anything about webpack unfortunately

juhoteperi15:01:34

@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

juhoteperi15:01:46

perhaps that somehow conflicts with Cljs

Pablo Fernandez15:01:33

Mhhh… I think I tried with and without it.... let me see.

juhoteperi15:01:41

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

Pablo Fernandez15:01:14

juhoteperi well… I’m not even sure what’s the state of NODE_ENV in a cljs project.

juhoteperi15:01:27

You were running webpack?

Pablo Fernandez15:01:59

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.

Pablo Fernandez15:01:40

By the way, doing npm install --production, had a completely different outcome (different error)

Pablo Fernandez15:01:39

So, running or not npm build makes not difference, I get the same error.

juhoteperi15:01:37

You probably need to run the npm build, but did you tryin running it with NODE_ENV=production set?

Pablo Fernandez15:01:07

No… I’m not sure how to do that in boot. Do you know?

juhoteperi15:01:23

((sh "NODE_ENV=production" "npm" "run" "build"))

Pablo Fernandez15:01:28

ok… rebuilding.

Pablo Fernandez16:01:00

That seems to have made the error go away. Awesome! thanks @juhoteperi

juhoteperi18:01:13

Yes, that is possible. You should define React as "external" or something in the webpack config

Pablo Fernandez18:01:52

Yes, I have it as external.

Pablo Fernandez20:01:01

I defined a couple more externals:

Pablo Fernandez20:01:53

But it doesn’t seem to be working as expected:

Pablo Fernandez20:01:20

What am I missing here?