-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with Winston library #58
Comments
I've seen this come up -- are you using custom preprocessing with Cypress? Like with webpack? |
Well, we used the Typescript plugin made by Gleb and so we, indeed, have got a webpack conf like the following:
But I don't think we've made any customization to that file at all. |
Gotcha, this is helpful. The error is related to Winston being transpiled when it's a node library. We don't see those issues on our example app since we're not doing anything like that. So! I'm going to take that and figure out what needs to be done to fix that. Off the top of my head, I'd be curious if this would be a suitable workaround: webpack-contrib/css-loader#447 (comment) |
@Robdel12 just had the chance to try and it's indeed solved by adding module.exports = {
+ node: {
+ fs: 'empty'
+ },
resolve: { Thanks for your help! There should be a better fix but in the meantime I'll be able to use Percy :) If you plan to fix it, keep the issue opened otherwise feel free to close it 👍 |
Sweet! That's good to know, I'm going to keep this open and see if we can find a better solution for this. |
Does this solve this though? I am trying to test cypress-react-unit-test using the plugin and while
with I got around this in https://percy.io/bahmutov/calculator by running locally and adding an option to
and it would be nice to expose this as a user option var healthcheck = "node " + _healthcheckPath(options) + " " + percyAgentClient.port; To recreate the problem:
and you will see the problem Here is how the healthcheck is transpiled by the way when webpack option is set to |
Yeah, I had a feeling introducing a I'm going to take a look at your PR + open a PR on |
This is to resolve the error where winston was being being included in various webpack bundles. We change the `main` entry point of the `@percy/agent` package so only the file that's ready for a browser is bundled. Then we transpile that file fully with babel and rollup so their webpack config isn't looking to compile it too. This solves percy/percy-cypress#58 fully.
This is to resolve the error where winston was being being included in various webpack bundles. We change the `main` entry point of the `@percy/agent` package so only the file that's ready for a browser is bundled. Then we transpile that file fully with babel and rollup so their webpack config isn't looking to compile it too. This solves percy/percy-cypress#58 fully.
This is to resolve the error where winston was being being included in various webpack bundles. We change the `main` entry point of the `@percy/agent` package so only the file that's ready for a browser is bundled. Then we transpile that file fully with babel and rollup so their webpack config isn't looking to compile it too. This solves percy/percy-cypress#58 fully.
Hey @bahmutov & everyone here, We've been hard at work to solve that issue over the past few days. I'm working on a change that will get rid of adding this from your configs:
What is happening is webpack is trying to bundle our node code with the small amount of browser code that we have in For @bahmutov (& @mapsandapps) regarding the health check issue with webpack, we shipped a new version of this SDK that should clear that right up ( bahmutov/calculator@add-percy...Robdel12:rd/add-percy I'll also be using that as a test for the bundling fixes I talked about earlier. I'd love to hear if the new version of the SDK unblocks y'all! |
v1.0.5 seems to be working. Thanks for the fix! |
nice, works for my calculator demo, thank you |
This is to resolve the error where winston was being being included in various webpack bundles. We change the `main` entry point of the `@percy/agent` package so only the file that's ready for a browser is bundled. Then we transpile that file fully with babel and rollup so their webpack config isn't looking to compile it too. This solves percy/percy-cypress#58 fully.
* Introduce rollup config This is to resolve the error where winston was being being included in various webpack bundles. We change the `main` entry point of the `@percy/agent` package so only the file that's ready for a browser is bundled. Then we transpile that file fully with babel and rollup so their webpack config isn't looking to compile it too. This solves percy/percy-cypress#58 fully. * Remove browser field, remove logger, test in other SDKs Most of the errors stemmed from us using the logger (which is a node logger) in our SDK utils, which is apart of our main export of the package. This would cause bundlers to try and bundle that code and fail because it couldn't find FS * Remove changes to `sdk-utils.ts` file That will be handled in a different PR and we're changing the way SDKs import that file
For those that had the workaround their webpack configs to exclude fs: module.exports = {
+ node: {
+ fs: 'empty'
+ },
resolve: { You can remove that now with the latest version of the |
I'm currently trying to setup Percy into Cypress, following this tutorial: https://docs.percy.io/docs/cypress
I then get an error
Can't resolve fs...
. Here's the stacktrace:I've done
import '@percy/cypress';
incommand.js
file and that's pretty much it 🤷♂️. Any idea? I might be missing something obvious too...Thanks!
The text was updated successfully, but these errors were encountered: