question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when using log-level 5

See original GitHub issue

🐛 bug report

If you specify log-level 5 an error is thrown and the build fails.

🎛 Configuration (.babelrc, package.json, cli command)

parcel build src/index.hbs --log-level 5

🤔 Expected Behavior

A log file should be created

😯 Current Behavior

[1:05:19 AM]: Building...
events.js:173
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open 'D:\git\personal-website\parcel-debug-2019-05-31T15:05:19.980Z.log'
Emitted 'error' event at:
    at fs.open (internal/fs/streams.js:292:12)
    at FSReqCallback.args [as oncomplete] (fs.js:147:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! personal-website@ build: `parcel build src/index.hbs --log-level 5`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the personal-website@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\josh\AppData\Roaming\npm-cache\_logs\2019-05-31T15_05_20_019Z-debug.log

🌍 Your Environment

Software Version(s)
Parcel 1.12.3
Node 11.6.0
npm 6.5.0-next.0
Operating System Windows 10

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
oddeirikcommented, Apr 28, 2020

If you could do it, I’d be happy. I’m running low on spare time this week. And besides, you’ve clearly been annoyed by this bug far longer than me 😄

1reaction
oddeirikcommented, Apr 27, 2020

I came across this bug as well. This is because the log file name contains a date/time string with colons, which is not a valid character on Windows:

path.join(process.cwd(), `parcel-debug-${currDate.toISOString()}.log`)

https://github.com/parcel-bundler/parcel/blob/master/packages/core/logger/src/Logger.js#L78

A quick string.replace with dashes or some other valid character should do the trick:

path.join(process.cwd(), `parcel-debug-${currDate.toISOString().replace(/\:/g, '-')}.log`)

🌍 Your Environment

Software Version(s)
Parcel 1.12.4
Node 12.16.2
npm/Yarn 6.14.4
Operating System Windows 10 1909 (build 18363.815)
Read more comments on GitHub >

github_iconTop Results From Across the Web

When to use the different log levels - Stack Overflow
The ERROR log level can be used when one of the payment systems is not available, but there is still the option to...
Read more >
Log Levels Explained and How to Use Them - Better Stack
The ERROR log level is used to represent error conditions in an application that prevent a specific operation from running, ...
Read more >
Logging Levels: What They Are & How to Choose Them
ERROR – the log level that should be used when the application hits an issue preventing one or more functionalities from properly functioning....
Read more >
LogLevel Enum (Microsoft.Extensions.Logging)
Specifies that a logging category should not write any messages. Logs that contain the most detailed messages. These messages may contain sensitive application ......
Read more >
loglevel - npm
Log things at a given level (trace/debug/info/warn/error) to the console object (as seen in all modern browsers & node. · Filter logging by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found