-
-
Notifications
You must be signed in to change notification settings - Fork 123
TypeError: yaml.stringify is not a function #163
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
Comments
Could you clarify how exactly that error shows up, and which Node.js version you're using? I couldn't reproduce any error with api-explorer's tests or build using yaml 1.9.2 with Node.js 13.10.1:
|
I am running Node 10.16.0 and am only seeing the error in the browser. You can pull down the
Then load up http://localhost:9966/ and you'll see the following error: I added some debug into |
Okay, I see it now. Bother. What's happening here is that There's a Babel plugin babel-plugin-add-module-exports that fixes this in the general case, but based on a quick test that appears to cause issues with some of your other imports. Same with using the I think I need to switch the |
Interesting. Alright! I wonder if Webpack 5 will help to get this working right. |
Hi there, we use swagger2openapi converting Swagger YAML files to OpenAPI JSON, and over the past week they updated their
yaml
dependency to 1.9.2, which has started to throwTypeError: yaml.stringify is not a function
in browsers for us.Downgrading yaml to 1.8.3 resolves the issue, and after digging in their source they just load yaml and run
yaml.strinfigy
. Looking at the release notes for 1.9.x I see you've made some changes to how ES module exports function for browsers, but it's not clear if we need to do anything in our Webpack config orpackage.json
file for supporting this.Any ideas?
The text was updated successfully, but these errors were encountered: