akanix42 / meteor-css-modules

MIT License
92 stars 20 forks source link

1.1.2 still throwing 'substr' error #31

Closed newswim closed 8 years ago

newswim commented 8 years ago

I first performed meteor reset, then updated to the latest versions of Meteor and CSS-Modules, started up the app and got the previously encountered 'substr' error. @gadicc had worked around this prior to 1.1.2 by commenting out this line.. however, afaik this issue was resolved in the last update. Are there any additional steps I should take?

In the meantime, I'm running Meteor@1.3.1 and everything seems ok.

Here's the console dump ``` => Started proxy. => Started MongoDB. /Users/dm/.meteor/packages/nathantreid_css-modules/.1.1.2.d7gi9d++os.osx.x86_64+web.browser+web.cordova/plugin.mss.os.osx.x86_64/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:116 throw error; ^ TypeError: Cannot call method 'substr' of undefined at Function. (/Users/dm/.meteor/packages/meteor-tool/.1.3.2_4.16dci36++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/source-map/lib/source-node.js:115:29) at Array.forEach (native) at SourceMapConsumer_eachMapping [as eachMapping] (/Users/dm/.meteor/packages/meteor-tool/.1.3.2_4.16dci36++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/source-map/lib/source-map-consumer.js:155:16) at Function.SourceNode_fromStringWithSourceMap [as fromStringWithSourceMap] (/Users/dm/.meteor/packages/meteor-tool/.1.3.2_4.16dci36++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/source-map/lib/source-node.js:80:26) at getChunk (/tools/isobuild/import-scanner.js:291:20) at ImportScanner._combineFiles (/tools/isobuild/import-scanner.js:299:7) at /tools/isobuild/import-scanner.js:187:14 at Array.forEach (native) at ImportScanner.addInputFiles (/tools/isobuild/import-scanner.js:158:11) at /tools/isobuild/compiler-plugin.js:834:15 at Array.forEach (native) at Function.computeJsOutputFilesMap (/tools/isobuild/compiler-plugin.js:805:19) at ClientTarget._emitResources (/tools/isobuild/bundler.js:913:8) at /tools/isobuild/bundler.js:684:12 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:675:18) at /tools/isobuild/bundler.js:2474:14 at /tools/isobuild/bundler.js:2563:20 at Array.forEach (native) at Function._.each._.forEach (/Users/dm/.meteor/packages/meteor-tool/.1.3.2_4.16dci36++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11) at /tools/isobuild/bundler.js:2562: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:2455:31) at /tools/runners/run-app.js:591:36 at Function.run (/tools/tool-env/profile.js:489:12) at bundleApp (/tools/runners/run-app.js:581:34) at AppRunner._runOnce (/tools/runners/run-app.js:634:35) at AppRunner._fiber (/tools/runners/run-app.js:887:28) at /tools/runners/run-app.js:411:12 ```
pertinent parts of package.json ``` json "cssModules": { "extensions": [ "mss", "scss", "m.styl" ], "globalVariables": [ "node_modules/react-toolbox/lib/_colors.scss", { "theme-building": true }, "client/toolbox-theme.scss" ], "outputJsFilePath": { "node_modules/react-toolbox/.*": "{dirname}/{basename}.js" }, "explicitIncludes": [ "node_modules/react-toolbox" ] } ```
hervejegou commented 8 years ago

same here... with Meteor@1.3.2 and the latest meteor-css-module@1.1.2, I get the same error: Cannot call method 'substr' of undefined running with $ meteor --release 1.3.1 solves the issue. Will continue with 1.3.1 while hoping for a fix.

shenrenguo commented 8 years ago

+1 with Meteor@1.3.2.4 and css-module@1.1.2 osx

error message: node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:116 throw error; ^ TypeError: Cannot call method 'substr' of undefined at Function. (/Users/srg/.meteor/packages/meteor-tool/.1.3.2_4.1kbuth2++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/source-map/lib/source-node.js:115:29)

akanix42 commented 8 years ago

Just posted the react toolbox example app updates; there are 2 configuration changes. First, Meteor 1.3.2.4 supports importing SCSS files from node_modules, so you need to remove the explicitIncludes section from package.json. Second, Meteor doesn't support the imports as fully as it does from normal app folders, so we still output the style.scss file as style.js in order for the import './style'; to work; the outputJsFilePath changes from "{dirname}/{basename}.js" to "{dirname}/{basename}". The ".js" is now automatically added to resolve a different issue.

With that we are almost done with the hacky settings. Hopefully in a future version of Meteor file from node_modules will get the same treatment as files in your app, after which we can remove the outputJsFilePath entirely.

newswim commented 8 years ago

Works great! Thank you * million, Nathan!

hervejegou commented 8 years ago

Thanks it works very well now. It is great to be able to use React Toolbox with css modules (instead of inline styles in Material ui).

judsonbsilva commented 8 years ago

Works great! Thank you * million, Nathan! +