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

Modulus fails when project uses meteor-webpack package #224

Open
vladejs opened this issue Sep 1, 2016 · 11 comments
Open

Modulus fails when project uses meteor-webpack package #224

vladejs opened this issue Sep 1, 2016 · 11 comments
Assignees
Labels

Comments

@vladejs
Copy link

vladejs commented Sep 1, 2016

Hello, I have several projects hosted on modulus. All I do is bundle my projects in a .zip and upload them to the platform. Modulus does the rest ( realize which meteor version to use, which packages to install etc ).

With a project that uses webpack, modulus fails with this output:

Starting build.
Creating directories for build environment.
Downloading source.
Executing build.
Now using node v4.4.7 (npm v3.10.5)
Initializing Meteor environment.
Using METEOR@1.3.3.1.
Demeteorizing application...
TypeError: undefined is not a function
at config (eval at readPackageConfig (packages/webpack:webpack/plugin/WebpackCompiler.js:304:28), :57:18)
at packages/webpack:webpack/plugin/WebpackCompiler.js:325:26
at Array.forEach (native)
at Object.load (packages/webpack:webpack/plugin/WebpackCompiler.js:323:15)
at WebpackCompiler.processFilesForTarget (packages/webpack:webpack/plugin/WebpackCompiler.js:131:13)
at bottom_mark (/tools/utils/parse-stack.js:64:14)
at /tools/isobuild/compiler-plugin.js:188:13
at /tools/utils/buildmessage.js:359:18
at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
at /tools/utils/buildmessage.js:352:34
at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
at /tools/utils/buildmessage.js:350:23
at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
at Object.enterJob (/tools/utils/buildmessage.js:324:26)
at /tools/isobuild/compiler-plugin.js:177:22
at Function.time (/tools/tool-env/profile.js:305:10)
at /tools/isobuild/compiler-plugin.js:176:15
at Function..each..forEach (/mnt/home/.meteor/packages/meteor-tool/.1.3.3_1.wzhjxc++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
at CompilerPluginProcessor.runCompilerPlugins (/tools/isobuild/compiler-plugin.js:166:7)
at ClientTarget.runCompilerPlugins (/tools/isobuild/bundler.js:913:22)
at /tools/isobuild/bundler.js:693:34
at /tools/utils/buildmessage.js:359:18
at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
at /tools/utils/buildmessage.js:352:34
at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
at /tools/utils/buildmessage.js:350:23
at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
at Object.enterJob (/tools/utils/buildmessage.js:324:26)
at ClientTarget.make (/tools/isobuild/bundler.js:687:18)
at /tools/isobuild/bundler.js:2533:14
at /tools/isobuild/bundler.js:2622:20
at Array.forEach (native)
at Function.
.each..forEach (/mnt/home/.meteor/packages/meteor-tool/.1.3.3_1.wzhjxc++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
at /tools/isobuild/bundler.js:2621:7
at /tools/utils/buildmessage.js:271:13
at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
at /tools/utils/buildmessage.js:264:29
at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
at /tools/utils/buildmessage.js:262:18
at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
at /tools/utils/buildmessage.js:253:23
at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
at Object.capture (/tools/utils/buildmessage.js:252:19)
at Object.exports.bundle (/tools/isobuild/bundler.js:2514:31)
at buildCommand (/tools/cli/commands.js:896:30)
at Command.main.registerCommand.
.extend.name as func
at /tools/cli/main.js:1402:23
Errors prevented bundling:
While processing files with webpack:webpack (for target web.browser):
error: Can't load npm module
'/mnt/input/node_modules/extract-text-webpack-plugin' from
packages/webpack_npmworkaround.js. Check your Npm.depends().
src/index.js: Entry module not found: Error: Cannot resolve module 'babel' in
/mnt/input
resolve module babel in /mnt/input

While processing files with fourseven:scss (for target web.browser):
/src/client/styles/bootstrap-custom.scss: Scss compiler error: File to import:
{}/node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables not found
in file: /mnt/input/{}/src/client/styles/bootstrap-custom.scss

While processing files with webpack:webpack (for target os.linux.x86_64):
src/main.js: Entry module not found: Error: Cannot resolve module 'babel' in
/mnt/input
resolve module babel in /mnt/input

Conversion failed.
Build attempt failed, attempting again.
Starting build.
Creating directories for build environment.
Downloading source.
Executing build.
Now using node v4.4.7 (npm v3.10.5)
Initializing Meteor environment.
Using METEOR@1.3.3.1.
Demeteorizing application...
Log Stream Disconnected
Does someone know a workaround to fix this?

@theworkflow theworkflow self-assigned this Sep 2, 2016
@theworkflow
Copy link
Contributor

@vladejs do you have any source code that we can test this out with? Also, what changes were made to the project to create this error? If you revert those changes, do you still get the same output?

@vladejs
Copy link
Author

vladejs commented Sep 3, 2016

@theworkflow, Any empty meteor project who uses meteor-webpack package has this error.

You can try with any of thereactivestack starter projects.

The package who causes trouble is here.

To reproduce the error you can try:

meteor create project
cd project
meteor add webpack:webpack webpack:react webpack:coffeescript

# zip the project (without .meteor/local folder)
# and upload it to modulus via web interface
# modulus will throw the above error.

@jackboberg
Copy link
Contributor

@vladejs Since @theworkflow is on vacation this week, I'm trying to jump in an help. Attempting to reproduce your project I get this:

› meteor add webpack:webpack webpack:scss
 => Errors while parsing arguments:

While adding package webpack:scss:
error: no such package

@vladejs
Copy link
Author

vladejs commented Sep 7, 2016

Hello @jackboberg, the package is webpack:css. Today I uploaded the same source code to modulus, the only change I made was upgrading meteor version to 1.4.1, it almost worked, but gave me following error.

webpack:webpack                    added, version 1.3.4

TypeError: ExtractTextPlugin is not a function
    at config (eval at readPackageConfig (packages/webpack:webpack/plugin/WebpackCompiler.js:325:28), <anonymous>:57:18)
    at packages/webpack:webpack/plugin/WebpackCompiler.js:346:26
    at Array.forEach (native)

This is the whole output from modulus:

Starting build.
Creating directories for build environment.
Downloading source.
Executing build.
Now using node v4.4.7 (npm v3.10.5)
Installing root package.json dependencies.
nvase@ /mnt/input
├── bootstrap-sass@3.3.7 
├─┬ mobx-react@3.5.5 
│ └── hoist-non-react-statics@1.2.0 
├─┬ react@15.3.1 
│ ├─┬ fbjs@0.8.4 
│ │ ├── core-js@1.2.7 
│ │ ├── immutable@3.8.1 
│ │ ├─┬ isomorphic-fetch@2.2.1 
│ │ │ ├─┬ node-fetch@1.6.0 
│ │ │ │ ├─┬ encoding@0.1.12 
│ │ │ │ │ └── iconv-lite@0.4.13 
│ │ │ │ └── is-stream@1.1.0 
│ │ │ └── whatwg-fetch@1.0.0 
│ │ ├─┬ promise@7.1.1 
│ │ │ └── asap@2.0.4 
│ │ └── ua-parser-js@0.7.10 
│ ├─┬ loose-envify@1.2.0 
│ │ └── js-tokens@1.0.3 
│ └── object-assign@4.1.0 
├── react-addons-pure-render-mixin@15.3.1 
├─┬ react-bootstrap@0.29.5 
│ ├── babel-runtime@5.8.38 
│ ├── classnames@2.2.5 
│ ├── dom-helpers@2.4.0 
│ ├── invariant@2.2.1 
│ ├── keycode@2.1.4 
│ ├── lodash-compat@3.10.2 
│ ├─┬ react-overlays@0.6.6 
│ │ ├── react-prop-types@0.4.0 
│ │ └── warning@3.0.0 
│ ├── react-prop-types@0.3.2 
│ ├── uncontrollable@3.3.1 
│ └── warning@2.1.0 
├── react-dom@15.3.1 
├─┬ react-komposer@1.13.1 
│ ├─┬ babel-runtime@6.11.6 
│ │ ├── core-js@2.4.1 
│ │ └── regenerator-runtime@0.9.5 
│ ├── mobx@2.5.1 
│ └─┬ shallowequal@0.2.2 
│   └─┬ lodash.keys@3.1.2 
│     ├── lodash._getnative@3.9.1 
│     ├── lodash.isarguments@3.1.0 
│     └── lodash.isarray@3.0.4 
├─┬ react-mounter@1.2.0 
│ ├─┬ babel-runtime@6.11.6 
│ │ └── core-js@2.4.1 
│ └── domready@1.0.8 
├─┬ react-no-ssr@1.1.0 
│ └─┬ babel-runtime@6.11.6 
│   └── core-js@2.4.1 
├─┬ uniforms@1.0.0-rc.31 
│ ├── lodash.clonedeep@4.5.0 
│ ├── lodash.get@4.4.2 
│ ├── lodash.isequal@4.4.0 
│ ├── lodash.set@4.3.2 
│ └── lodash.xorwith@4.5.0 
└── uniforms-bootstrap3@1.0.0-rc.31 

Initializing Meteor environment.
Using METEOR@1.4.1.
Demeteorizing application...

Changes to your project's package version selections:

accounts-base                      added, version 1.2.11
accounts-password                  added, version 1.3.0
aldeed:collection2                 added, version 2.10.0
aldeed:collection2-core            added, version 1.2.0
aldeed:schema-deny                 added, version 1.1.0
aldeed:schema-index                added, version 1.1.0
aldeed:simple-schema               added, version 1.5.3
allow-deny                         added, version 1.0.5
autoupdate                         added, version 1.2.11
babel-compiler                     added, version 6.9.1
babel-runtime                      added, version 0.1.11
base64                             added, version 1.0.9
binary-heap                        added, version 1.0.9
blaze                              added, version 2.1.8
blaze-tools                        added, version 1.0.9
blueimp:javascript-load-image      added, version 1.13.1
boilerplate-generator              added, version 1.0.9
caching-compiler                   added, version 1.1.7
caching-html-compiler              added, version 1.0.6
callback-hook                      added, version 1.0.9
check                              added, version 1.2.3
chuangbo:cookie                    added, version 1.1.0
coffeescript                       added, version 1.2.4_1
ddp                                added, version 1.2.5
ddp-client                         added, version 1.2.9
ddp-common                         added, version 1.2.6
ddp-rate-limiter                   added, version 1.0.5
ddp-server                         added, version 1.2.10
deps                               added, version 1.0.12
diff-sequence                      added, version 1.0.6
ecmascript                         added, version 0.5.8
ecmascript-runtime                 added, version 0.3.14
ejson                              added, version 1.0.12
email                              added, version 1.1.17
es5-shim                           added, version 4.6.14
fastclick                          added, version 1.0.12
fortawesome:fontawesome            added, version 4.5.0
fourseven:scss                     added, version 3.9.0
geojson-utils                      added, version 1.0.9
hot-code-push                      added, version 1.0.4
html-tools                         added, version 1.0.10
htmljs                             added, version 1.0.10
http                               added, version 1.2.9
id-map                             added, version 1.0.8
jquery                             added, version 1.11.9
kadira:dochead                     added, version 1.5.0
kadira:flow-router-ssr             added, version 3.13.0
launch-screen                      added, version 1.0.12
livedata                           added, version 1.0.18
localstorage                       added, version 1.0.11
logging                            added, version 1.1.15
mdg:validation-error               added, version 0.2.0
meteor                             added, version 1.2.17
meteor-base                        added, version 1.0.4
meteorhacks:fast-render            added, version 2.14.0
meteorhacks:inject-data            added, version 2.0.0
meteorhacks:meteorx                added, version 1.4.1
meteorhacks:picker                 added, version 1.0.3
minifier-css                       added, version 1.2.14
minifier-js                        added, version 1.2.14
minimongo                          added, version 1.0.17
mobile-experience                  added, version 1.0.4
mobile-status-bar                  added, version 1.0.12
modules                            added, version 0.7.6
modules-runtime                    added, version 0.7.6
mongo                              added, version 1.1.12
mongo-id                           added, version 1.0.5
npm-bcrypt                         added, version 0.9.1
npm-mongo                          added, version 1.5.49
observe-sequence                   added, version 1.0.12
ordered-dict                       added, version 1.0.8
ostrio:cookies                     added, version 2.0.5
ostrio:files                       added, version 1.7.3
promise                            added, version 0.8.4
raix:eventemitter                  added, version 0.1.3
random                             added, version 1.0.10
rate-limit                         added, version 1.0.5
reactive-dict                      added, version 1.1.8
reactive-var                       added, version 1.0.10
reload                             added, version 1.1.10
retry                              added, version 1.0.8
routepolicy                        added, version 1.0.11
service-configuration              added, version 1.0.10
sha                                added, version 1.0.8
spacebars                          added, version 1.0.12
spacebars-compiler                 added, version 1.0.12
srp                                added, version 1.0.9
standard-minifier-css              added, version 1.2.0
standard-minifier-js               added, version 1.2.0
templating                         added, version 1.2.14
templating-tools                   added, version 1.0.4
thinksoftware:image-resize-client  added, version 1.0.0
tracker                            added, version 1.1.0
ui                                 added, version 1.0.11
underscore                         added, version 1.0.9
url                                added, version 1.0.10
webapp                             added, version 1.3.11
webapp-hashing                     added, version 1.0.9
webpack:assets                     added, version 1.0.1
webpack:coffeescript               added, version 1.0.1
webpack:core-config                added, version 1.0.1
webpack:css                        added, version 1.1.2
webpack:json                       added, version 1.0.1
webpack:npmworkaround              added, version 1.0.0
webpack:react                      added, version 1.2.2
webpack:reload                     added, version 1.0.1
webpack:webpack                    added, version 1.3.4

TypeError: ExtractTextPlugin is not a function
    at config (eval at readPackageConfig (packages/webpack:webpack/plugin/WebpackCompiler.js:325:28), <anonymous>:57:18)
    at packages/webpack:webpack/plugin/WebpackCompiler.js:346:26
    at Array.forEach (native)
    at Object.load (packages/webpack:webpack/plugin/WebpackCompiler.js:344:15)
    at WebpackCompiler.processFilesForTarget (packages/webpack:webpack/plugin/WebpackCompiler.js:152:13)
    at __bottom_mark__ (/tools/utils/parse-stack.js:64:14)
    at /tools/isobuild/compiler-plugin.js:188:13
    at /tools/utils/buildmessage.js:359:18
    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:352:34
    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:350:23
    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
    at Object.enterJob (/tools/utils/buildmessage.js:324:26)
    at /tools/isobuild/compiler-plugin.js:177:22
    at Function.time (/tools/tool-env/profile.js:305:10)
    at /tools/isobuild/compiler-plugin.js:176:15
    at Function._.each._.forEach (/mnt/home/.meteor/packages/meteor-tool/.1.4.1.nxkzts++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
    at CompilerPluginProcessor.runCompilerPlugins (/tools/isobuild/compiler-plugin.js:166:7)
    at ClientTarget._runCompilerPlugins (/tools/isobuild/bundler.js:918:22)
    at /tools/isobuild/bundler.js:698:34
    at /tools/utils/buildmessage.js:359:18
    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:352:34
    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:350:23
    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
    at Object.enterJob (/tools/utils/buildmessage.js:324:26)
    at ClientTarget.make (/tools/isobuild/bundler.js:692:18)
    at /tools/isobuild/bundler.js:2586:14
    at /tools/isobuild/bundler.js:2675:20
    at Array.forEach (native)
    at Function._.each._.forEach (/mnt/home/.meteor/packages/meteor-tool/.1.4.1.nxkzts++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
    at /tools/isobuild/bundler.js:2674:7
    at /tools/utils/buildmessage.js:271:13
    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:264:29
    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:262:18
    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:253:23
    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
    at Object.capture (/tools/utils/buildmessage.js:252:19)
    at bundle (/tools/isobuild/bundler.js:2567:31)
    at /tools/isobuild/bundler.js:2514:32
    at Object.withCache (/tools/fs/files.js:1585:12)
    at Object.exports.bundle (/tools/isobuild/bundler.js:2514:16)
    at buildCommand (/tools/cli/commands.js:918:30)
    at Command.func (/tools/cli/commands.js:798:12)
    at /tools/cli/main.js:1410:23

@jackboberg
Copy link
Contributor

@vladejs Still attempting to reproduce your instructions locally, before attempting to deploy to Modulus:

› meteor add webpack:webpack webpack:react webpack:coffeescript

Changes to your project's package version selections:

webpack:assets         added, version 1.0.1
webpack:coffeescript   added, version 1.0.1
webpack:core-config    added, version 1.0.1
webpack:css            added, version 1.1.2
webpack:json           added, version 1.0.1
webpack:npmworkaround  added, version 1.0.0
webpack:react          added, version 1.2.2
webpack:reload         added, version 1.0.1
webpack:webpack        added, version 1.3.4


webpack:webpack: Seamlessly integrate Webpack to improve Meteor build system
webpack:react: Integrate React with Webpack
webpack:coffeescript: Integrate CoffeeScript with Webpack

And then:

› meteor run
[[[[[ ~/Documents/Projects/modulus/_sandbox/meteor/webpack/project ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Errors prevented startup:

   While determining active plugins:
   error: conflict: two packages included in the app (webpack:webpack and ecmascript) are both trying to handle *.js
   error: conflict: two packages included in the app (webpack:webpack and ecmascript) are both trying to handle *.jsx

   While determining active plugins:
   error: conflict: two packages included in the app (webpack:webpack and ecmascript) are both trying to handle *.js
   error: conflict: two packages included in the app (webpack:webpack and ecmascript) are both trying to handle *.jsx

=> Your application has errors. Waiting for file change.

Are you not getting that locally? If you would rather, you can open a support ticket and provide access to your source. help@modulus.io

@vladejs
Copy link
Author

vladejs commented Sep 7, 2016

Did you at least read the error? Pretty obvious to me:

meteor remove ecmascript

That's a prerequisite to work with webpack:webpack package.

Anyway, I am wondering why you are trying to reproduce the error by creating a project yourself?. In my comment above there is a link with tons of kickstarter project that uses webpack:webpack package. You can try any of them. However, I don't think they will have trouble locally, because locally everything works perfect to me:

meteor --production       # works
meteor build                 # works
demeteorizer -o output  # works 

Troubles are when uploading to modulus, so, take a kickstarter and try to deploy it there.

@jackboberg
Copy link
Contributor

jackboberg commented Sep 7, 2016

I am trying to follow your example exactly so that I know if I get my app to work I can confidently tell you how I resolved it.

Following along, after meteor remove ecmascript I get another error.

Cannot find the entry point "index.js" for the web

Of course the next step is obvious, but again, I'm trying to duplicate your exact issue. Since you now think following your example script is a waste of time, I will stop..

Grabbing a sample project from thereactivestack/kickstart now..

@vladejs
Copy link
Author

vladejs commented Sep 7, 2016

Yes, create a webpack project from scratch involves generating some files
manually, like your missing index.js.

I recommended using a kickstart project because the problem is common for
every one of them. It doesn't matter how the project is created, if it uses
webpack:webpack package, it will throw errors on modulus. So, you can grab
the one you prefer.

Also notice that locally no errors are thrown.
El 7/9/2016 1:43 PM, "Jack Boberg" notifications@github.com escribió:

I am trying to follow your example exactly so that I know if I get my app
to work I can confidently tell you how I resolved it.

Following along, after meteor remove ecmascript I get another error.

Cannot find the entry point "index.js" for the web

Of course the next step is obvious, but again, I'm trying to duplicate
your exact issue. Since you now think following your example script is a
waste of time, I will stop..

Grabbing a sample project from thereactivestack
https://github.com/thereactivestack/ now..


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#224 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMDUAhxzXzgs-1f7O16hH16hqpg_7_rgks5qnvepgaJpZM4JzGOH
.

@jackboberg
Copy link
Contributor

@vladejs reproduced the issue with kickstart-meteor-react-flowrouter. I'll update if/when I find any resolutions..

@vladejs
Copy link
Author

vladejs commented Sep 10, 2016

It would be awesome to find a solution to this error, since we are migrating several meteor projects to use webpack and don't want to switch to galaxy yet.

@mycyberacademy
Copy link

@jackboberg , @theworkflow , please see #235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants