Doesn't work on Node 14
boris-petrov opened this issue · 4 comments
I'm not exactly sure the problem is in this plugin, but I'm getting:
Build Error (PostcssCompiler)
The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of SourceMapGenerator
And the details in the log file:
- broccoliBuilderErrorStack: TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of SourceMapGenerator
at Object.writeFileSync (fs.js:1380:5)
at /home/boris/project/node_modules/broccoli-postcss-single/index.js:82:12
- code: [undefined]
- codeFrame: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of SourceMapGenerator
- errorMessage: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of SourceMapGenerator
at PostcssCompiler
-~- created here: -~-
at PostcssCompiler.Plugin (/home/boris/project/node_modules/broccoli-plugin/index.js:7:31)
at PostcssCompiler.CachingWriter [as constructor] (/home/boris/project/node_modules/broccoli-caching-writer/index.js:18:10)
at new PostcssCompiler (/home/boris/project/node_modules/broccoli-postcss-single/index.js:23:17)
at /home/boris/project/node_modules/ember-cli-postcss/index.js:36:12
at Array.map (<anonymous>:null:null)
at PostcssPlugin.toTree (/home/boris/project/node_modules/ember-cli-postcss/index.js:33:36)
at /home/boris/project/node_modules/ember-cli-preprocess-registry/preprocessors.js:188:26
at Array.forEach (<anonymous>:null:null)
at processPlugins (/home/boris/project/node_modules/ember-cli-preprocess-registry/preprocessors.js:186:11)
at module.exports.preprocessCss (/home/boris/project/node_modules/ember-cli-preprocess-registry/preprocessors.js:156:10)
at DefaultPackager.packageStyles (/home/boris/project/node_modules/ember-cli/lib/broccoli/default-packager.js:558:32)
at EmberApp._legacyPackage (/home/boris/project/node_modules/ember-cli/lib/broccoli/ember-app.js:1618:44)
at EmberApp.toTree (/home/boris/project/node_modules/ember-cli/lib/broccoli/ember-app.js:1663:27)
at module.exports (/home/boris/project/ember-cli-build.js:299:14)
at Builder.readBuildFile (/home/boris/project/node_modules/ember-cli/lib/models/builder.js:49:14)
at Builder.setupBroccoliBuilder (/home/boris/project/node_modules/ember-cli/lib/models/builder.js:63:22)
at new Builder (/home/boris/project/node_modules/ember-cli/lib/models/builder.js:29:10)
at ServeTask.run (/home/boris/project/node_modules/ember-cli/lib/tasks/serve.js:49:7)
at /home/boris/project/node_modules/ember-cli/lib/models/command.js:238:24
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Any ideas?
P.S. Everything is the latest possible version.
Thanks for reporting.
The line number referenced in the error is where sourcemaps are written to a file. I haven't looked into it yet, but it seems like something changed in Node 14 where the sourcemap information will need to be converted to a different type before written to a file.
If you're okay with temporarily disabling sourcemaps while I look into this you can do so by tweaking your options to have map: false
in the compile step:
postcssOptions: {
compile: {
map: false,
...
}
}
Please let me know if the above allows you to run the addon in Node 14. Thanks.
Thank you for the support!
You're right, disabling sourcemaps does fix the issue and ember serve
starts fine now. So the issue is somewhere with them as you said.
You're welcome! Okay great, thanks for confirming that fixed the issue. I think I've found what's causing the problem, but I'll need to make the fix in one of the dependencies.
I'll close this issue once I've made a new patch release with the fix. Cheers.