The "data" argument must be one of type string, TypedArray, or DataView. Received type object
See original GitHub issue🐛 bug report
Watching .sass
files resulted in a weird exception. It only happened once and I’m not able to reproduce it.
🎛 Configuration (.babelrc, package.json, cli command)
No configuration.
🤔 Expected Behavior
The .sass
files should be compiled normally.
😯 Current Behavior
The compilation fails with the following error:
> parcel watch resources/sass/*.sass --no-source-maps -d public/assets/css --no-hmr
🚨 The "data" argument must be one of type string, TypedArray, or DataView. Received type object
at Hash.update (internal/crypto/hash.js:58:11)
at Bundle.getHash (/mnt/Portable/Projekte/treb/node_modules/parcel-bundler/src/Bundle.js:301:12)
at Bundle.package (/mnt/Portable/Projekte/treb/node_modules/parcel-bundler/src/Bundle.js:186:23)
at Bundler.bundle (/mnt/Portable/Projekte/treb/node_modules/parcel-bundler/src/Bundler.js:325:56)
at process._tickCallback (internal/process/next_tick.js:68:7)
💁 Possible Solution
???
🔦 Context
I need the .sass
files compiled to CSS.
💻 Code Sample
Nothing wrong with my .sass
files.
🌍 Your Environment
Software | Version(s) |
---|---|
Parcel | 1.12.3 |
Node | 10.16.3 |
npm/Yarn | 6.12.0 |
Operating System | Ubuntu x64 5.0.0-31-generic #33~18.04.1 |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:13
Top Results From Across the Web
node.js - NodeJS: Data argument must be of type string/Buffer ...
So the error is saying the data (second argument of the fs.writeFileSync function) should be a string or a buffer...etc but instead got...
Read more >typeerror: the "data" argument must be of type string or an ...
So the error is saying the data (second argument of the fs.writeFileSync function) should be a string or a buffer...etc but instead got...
Read more >TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument ...
AssertionError: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an ...
Read more >Help needed: The "data" argument must be of type string or an ...
Received an instance of Node - Ember.JS ...
Read more >The "data" argument must be of type string or an instance of ...
**TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This may or may not help anyone else (doesn’t fix parcel itself either), but I also got this error and it turned out I had a script tag pointing to a non-existent file. Fixing that resolved this issue for me. 👍
Hit this bug as well. It only happens on refresh when there is a malformed target.
I added some exception-handling code to Bundle.js, and discovered that it was because of malformed HTML in a watched file, specifically:
I modified
Bundle.js
to add some error handling:Which gave me this output (path elided):
Hopefully this is enough detail for someone to fix this! I’d love to get the root error message (“index.html:1:1: Unexpected token (1:1)”) instead of the weird TypeError message.