google / material-design-lite

Material Design Components in HTML/CSS/JS
https://getmdl.io
Apache License 2.0
32.28k stars 5.05k forks source link

styletemplates gulp task fails #4443

Open pherrymason opened 8 years ago

pherrymason commented 8 years ago

Trying to build the project (v1.1.3) with gulp as the instructions say throws me this error:

Requiring external module babel-core/register
/Volumes/xxxx/material-design-lite/node_modules/babel-core/lib/transformation/file/options/option-manager.js:126
  if (!option) this.log.error("Unknown option: " + alias + "." + key, Refe
                       ^
TypeError: Cannot read property 'error' of undefined
at OptionManager.mergeOptions (/Volumes/xxxx/material-design-lite/node_modules/babel-core/lib/transformation/file/options/option-manager.js:126:28)
at OptionManager.addConfig (/Volumes/xxxx/material-design-lite/node_modules/babel-core/lib/transformation/file/options/option-manager.js:107:10)
at OptionManager.findConfigs (/Volumes/xxxx/material-design-lite/node_modules/babel-core/lib/transformation/file/options/option-manager.js:168:35)
at OptionManager.init (/Volumes/xxxx/material-design-lite/node_modules/babel-core/lib/transformation/file/options/option-manager.js:229:12)
at compile (/Volumes/xxxx/material-design-lite/node_modules/babel-core/lib/api/register/node.js:117:22)
at normalLoader (/Volumes/xxxx/material-design-lite/node_modules/babel-core/lib/api/register/node.js:199:14)
at Object.require.extensions.(anonymous function) [as .js] (/Volumes/xxxx/material-design-lite/node_modules/babel-core/lib/api/register/node.js:216:7)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)

I'm on OSX 10.10.5, using node 0.12.2, gulp 3.9.1

Garbee commented 8 years ago

Which branch are you on?

Have you removed the node-modules folder and re-installed the deps?

pherrymason commented 8 years ago

I'm at v1.1.3 branch. Removing the node-modules and reinstalling seems to have cleaned something, but meanwhile still fails it has advanced a little more:

gulp all
[10:38:09] Failed to load external module babel-register
[10:38:09] Requiring external module babel-core/register
[10:38:09] Using gulpfile /Volumes/xxxxx/material-design-lite/gulpfile.babel.js
[10:38:09] Starting 'clean'...
[10:38:09] Finished 'clean' after 12 ms
[10:38:09] Starting 'all'...
[10:38:09] Starting 'styletemplates'...
fs.js:0
(function (exports, require, module, __filename, __dirname) { // Copyright Joy

Error: ENOENT, no such file or directory '/Volumes/xxxxx/material-design-lite/dist/material.min.css.template'
    at Error (native)
    at Object.fs.lstatSync (fs.js:792:18)
    at DestroyableTransform.TransformStream [as _transform] (/Volumes/xxxxx/material-design-lite/node_modules/gulp-header/index.js:38:12)
    at DestroyableTransform.Transform._read (/Volumes/xxxxx/material-design-lite/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at DestroyableTransform.Transform._write (/Volumes/xxxxx/material-design-lite/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83)
    at doWrite (/Volumes/xxxxx/material-design-lite/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:313:64)
    at writeOrBuffer (/Volumes/xxxxx/material-design-lite/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:302:5)
    at DestroyableTransform.Writable.write (/Volumes/xxxxx/material-design-lite/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:241:11)
    at write (/Volumes/xxxxx/material-design-lite/node_modules/gulp-concat/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/Volumes/xxxxx/material-design-lite/node_modules/gulp-concat/node_modules/readable-stream/lib/_stream_readable.js:632:7)
Garbee commented 8 years ago

There is no v1.1.3 branch. Did you use the tag instead?

pherrymason commented 8 years ago

Yes sorry, I mean I'm using the v1.1.3 tag El 21/6/2016 13:35, "Jonathan Garbee" notifications@github.com escribió:

There is no v1.1.3 branch. Did you use the tag instead?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/google/material-design-lite/issues/4443#issuecomment-227413892, or mute the thread https://github.com/notifications/unsubscribe/ABDYaYuuAOF7M0Zmz1MonS16Tx6fPmdtks5qN8yVgaJpZM4I5wLH .

Garbee commented 8 years ago

We can't fix this in the 1.1.3 tag itself, but the build task is failing. We should take a look at this for the next release.

Thank you for the report.

dcm03 commented 1 year ago

The error message TypeError: Cannot read property 'error' of undefined is typically caused when you are trying to access a property of an object that is undefined or null. In this case, it appears that the error is occurring in the OptionManager.mergeOptions function at line 126 in the option-manager.js file, when the log.error method is being called with an object that does not have a error property.

There could be a number of reasons why this error is occurring. It's possible that the log object is not being properly initialized or is being set to undefined or null somewhere in the code. It could also be an issue with the configuration options being passed to the OptionManager.mergeOptions function, or with the way that the options are being processed.

To fix this error, you will need to identify the root cause of the undefined value for the log object and fix it. This may involve modifying the code that initializes the log object, or checking the configuration options and ensuring that they are valid. It's also a good idea to add additional error handling to your code to prevent this issue from occurring in the future.