Code Monkey home page Code Monkey logo

Comments (11)

geowarin avatar geowarin commented on June 11, 2024

Hello, which version of node do you use ?
I have updated the stackframe library recently, we could easily rollback.

I'm curious why CI did not catch this error thought...

from friendly-errors-webpack-plugin.

geowarin avatar geowarin commented on June 11, 2024

Can you reproduce the error with version 1.1.3 ?

from friendly-errors-webpack-plugin.

geowarin avatar geowarin commented on June 11, 2024

Should be fixed in v1.3.1. Please test it and tell me if it worked 😄

from friendly-errors-webpack-plugin.

aight8 avatar aight8 commented on June 11, 2024

I'm using node v7.4.0.

I currently testing it, but I think there was some massive conflict with another package called "pretty-error".

from friendly-errors-webpack-plugin.

geowarin avatar geowarin commented on June 11, 2024

I think the check has its place in the codebase, better safe than sorry.

Yes, it's weird: it could happen if webpack throws an error without having an original stacktrace (loader or something).

I've never seen it happen but, you know, webpack :neckbeard:

I'm curious to have your final diagnostic, though

from friendly-errors-webpack-plugin.

geowarin avatar geowarin commented on June 11, 2024

Yup, pretty errors messes up with stackframes.
Maybe you should open a bug there ?

from friendly-errors-webpack-plugin.

aight8 avatar aight8 commented on June 11, 2024

Yeah webpack can be really funny.

The structure was something like:

{ fileName: '\u001b[0m  \u001b[0m\u001b[97mParent style sheet: stdin\u001b[0m',
    source: '\u001b[0m  \u001b[0m\u001b[97mParent style sheet: stdin\u001b[0m' },
  { functionName: '\u001b[0m  \u001b[0m\u001b[97m      in /zzz/blabla.scss (line 2, column 1)\u001b[0m' },
  { functionName: '\u001b[0m  \u001b[0m' },

from friendly-errors-webpack-plugin.

aight8 avatar aight8 commented on June 11, 2024

Yep why not - it's always good if library don't disturb each other. I honestly have not much insights about both libs, just found friendly-errors-webpack-plugin before a hour :P So I currently cannot describe a change suggestion in their repo.

However I ended up just disable pretty-error. it works great now. Now friendy-errors are prettier!

from friendly-errors-webpack-plugin.

aight8 avatar aight8 commented on June 11, 2024

Wondering if you plan to merge some other common transformers etc. which are used a lot by webpack? I currently try to write custom ones but must research the code because the readme missing the function signatures and the error object structure. I try & error now...

from friendly-errors-webpack-plugin.

geowarin avatar geowarin commented on June 11, 2024

Your call.
To detect if an error comes from the eslint loader, we have no other choice than looking at the stackframe to see if it's in there somewhere.

So we use error-stack-parser to get a proper array of stackframes that we can investigate instead of a string.
The error you saw was because we assumed that the stackframe would always have a fileName field and that it should be a string.

We could actually write the following check tyepeof stackframe.fileName === 'string' but that would be a really weird precaution to take

from friendly-errors-webpack-plugin.

geowarin avatar geowarin commented on June 11, 2024

So I guess you could come up this the following repro if I understand the problem correctly:

require('pretty-error').start();
const ErrorStackParser = require('error-stack-parser');

const stack = ErrorStackParser.parse(new Error())
expect(stack.every(s => typeof s.fileName === 'string')).toBeTruthy()

from friendly-errors-webpack-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.