-
Notifications
You must be signed in to change notification settings - Fork 38
Unable to use with Webpack when targeting Node #89
Comments
Sorry same bug different version, I'll check it with Bowser. Actually 2.6.1 |
What error are you seeing in this package? |
|
I'll raise an issue with Bowser, for a quick fix i've moved Bowser back to 2.5.4 locally and all is working again. |
Could you post a code snippet that reproduces this? I'm not able to replicate the issue myself. |
It's because we use a bundler, webpack in this case. This change https://github.com/lancedikson/bowser/blob/bc2d51a8f9a715d91b715214ee0c19b1ca3f3838/package.json#L25 in bowser causes the imports to be incorrect. |
Ah, interesting—I take it you're doing some bundling on the Node side, then?
Could you share that setup (unless you're confident that this is a Bowser issue)?
|
TypeError: Bowser.getParser is not a function I am seeing this error while running Helmet: 3.21.1, Helmet: 2.9.2, and Bowser: 2.6.1 |
This appears to be happening because you're using Webpack for your Node server. Is that correct?
If so, do you think that's something Helmet should be concerning itself with? To my eye, that's arguably an issue with a nonstandard build setup, which I'm hesitant to support. What do you think?
In any case, it seems like it's a downstream issue with Bowser, but let me know if that's wrong.
|
This will affect everyone using helmet and webpack, targeting node environments. Downgrading helmet to 4.20.0, helmet-csp to 2.8.0 and removing bowser from yarn.lock fixed this for us for now. |
It looks like Bowser is now at version 2.7.0.
I plan to upgrade this module, but if you'd like to submit a pull request sooner, I'd appreciate it.
|
Pull request #94 submitted |
I've updated to the latest version of Does this fix anyone's issues? |
@EvanHahn It did not for me personally. What I am seeing now. |
I recently update helmet from 3.19.0 to 3.21.2 due to a recommendatiopn of npm audit. I have seen this happening before with webpack and redis npm package. Doing this with helmet also avoids the TypeError and you can continue your work. Here is an example webpack config.
|
I've renamed this because it seems like this is an issue with Webpack. Lemme know if that's wrong. It also seems like there's a fix (thanks @elvismercado), which is good for now. |
The bundle I am using has this issue as well. A quick fix was to change the
Having the bundler point to |
I believe this is fixed in |
Hello! I see you've just updated to Bowser 2.5.1 and we now hit this bug:
bowser-js/bowser#339
Could you bump again to 2.5.2?
Thanks!
The text was updated successfully, but these errors were encountered: