Skip to content
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

npm run build with olm #1765

Closed
dbkr opened this issue Jul 12, 2016 · 3 comments
Closed

npm run build with olm #1765

dbkr opened this issue Jul 12, 2016 · 3 comments

Comments

@dbkr
Copy link
Member

dbkr commented Jul 12, 2016

Gets an error for me when olm is installed:

ERROR in ../matrix-js-sdk/lib/OlmDevice.js
Module not found: Error: Cannot resolve module 'olm' in /Users/dave/matrix/matrix-js-sdk/lib
 @ ../matrix-js-sdk/lib/OlmDevice.js 18:10-24

Also is very slow, probably because olm.js is being minified which it would be good to skip if possible.

@richvdh
Copy link
Member

richvdh commented Jul 12, 2016

The critical information that is missing here is that the error happens when running npm run build in vector-web, with matrix-js-sdk symlinked into node_modules, and with Olm installed in vector-web and not matrix-js-sdk.

@richvdh
Copy link
Member

richvdh commented Jul 12, 2016

So the problem is that, when matrix-js-sdk is symlinked, webpack only looks for olm in matrix-js-sdk/node_modules, whereas the webpack configuration script has looked in vector-web/node_modules and found an olm. I could probably work around this with an alias.

As for the slowness, yes it's probably uglify running on olm.js. Whilst this is of course redundant, I don't believe it's possible to turn off uglify on a single input file - it can only be done for entire webpack chunks (see webpack/webpack#1079). We could split the vector dist up into more chunks to work around this, but that has some downsides too. In short, we might just have to put up with it.

richvdh added a commit that referenced this issue Jul 12, 2016
Fixes an error when matrix-js-sdk is symlinked into node_modules, which meant
that we would (try to) use the version of olm from js-sdk instead of
vector-web (#1765).
@richvdh
Copy link
Member

richvdh commented Jul 13, 2016

fixed by #1766, hopefs

@richvdh richvdh closed this as completed Jul 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants