-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
TypeError when building project, after upgrading to v2.0.0-beta.19 #7398
Comments
|
beta.20 did remove the warnings, thanks! As for the second suggestion, it got rid of the
|
No, I've not seen this before. Would be great if you can provide an isolated repro, thanks! |
For what it's worth, we encountered a similar issue when attempting to upgrade our plugin from beta.18 to beta.19 and then beta.20. Seeing same exact errors. Can reproduce it and link to a PR if it could be helpful? |
@sserrata That would definitely be helpful, our repo is private so to create a demo with the issue reproduced will likely take some time. Thanks! |
Reproduces Type Errors Observed in 2.0.0-beta.20Variant 1PR: PaloAltoNetworks/docusaurus-openapi-docs#81 Variant 2PR: PaloAltoNetworks/docusaurus-openapi-docs#82 Variant 3Description: Reproduces the |
I believe this issue is affecting the redocusaurus plugin too. |
Thanks @sserrata I will start with your isolated repro with the |
Can I get a confirmation that everyone running into this issue is using some kind of redoc/open API plugin? I did some preliminary hacks and found that the |
We have the same issue with
The error appeared since May 11th. On May 10th, the exactly same build process passed without any issues. |
We are indeed running an OpenAPI plugin although the error occurs only when we include the accompanying theme (since the plugin only extends the docusaurus CLI). I ran yarn why v1.22.18
[1/4] 🤔 Why do we have the module "strip-bom-string"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
- "_project_#docusaurus-plugin-openapi-docs#@docusaurus#utils#gray-matter" depends on it
- Hoisted from "_project_#docusaurus-plugin-openapi-docs#@docusaurus#utils#gray-matter#strip-bom-string"
info Disk size without dependencies: "16KB"
info Disk size with unique dependencies: "16KB"
info Disk size with transitive dependencies: "16KB"
info Number of shared dependencies: 0
yarn why v1.22.18
[1/4] 🤔 Why do we have the module "strip-bom"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "[email protected]"
info Has been hoisted to "strip-bom"
info Reasons this module exists
- "workspace-aggregator-c9e524fe-827a-4418-9f65-04fba450e1b0" depends on it
- Hoisted from "_project_#read-pkg#load-json-file#strip-bom"
- Hoisted from "_project_#eslint-plugin-import#tsconfig-paths#strip-bom"
info Disk size without dependencies: "16KB"
info Disk size with unique dependencies: "16KB"
info Disk size with transitive dependencies: "16KB"
info Number of shared dependencies: 0
=> Found "load-json-file#[email protected]"
info This module exists because "_project_#load-json-file" depends on it.
info Disk size without dependencies: "20KB"
info Disk size with unique dependencies: "20KB"
info Disk size with transitive dependencies: "20KB"
info Number of shared dependencies: 0
=> Found "jest-runtime#[email protected]"
info This module exists because "_project_#jest#@jest#core#jest-runtime" depends on it.
info Disk size without dependencies: "20KB"
info Disk size with unique dependencies: "20KB"
info Disk size with transitive dependencies: "20KB"
info Number of shared dependencies: 0
✨ Done in 0.70s. |
Thanks. I'm a bit busy these days with other business, while @slorber is on holiday. I'll try to spare some time in the next few days to debug this. Thanks again to everyone for staying around and helping out! |
Can confirm, we're also using redocusaurus! |
@Josh-Cena I've been trying to fix this on the redocusaurus side today. And for me this is the error troubling me, even on a fresh install. Build Logs: https://github.com/rohit-gohri/redocusaurus/runs/6432967265?check_suite_focus=true PR open here: rohit-gohri/redocusaurus#176 It seems every time there is a new beta it breaks my plugin. Is there anyway we can declare compatibility with docusaurus versions in the plugin's package.json? So that users are warned on upgrading past supported versions or something like that? It takes quite some time and effort to support the latest beta and fix the builds. |
There isn't an official way to do this, but you can import
I'm still not sure if it's a Docusaurus bug or a bug in redocusaurus yet... |
It was an issue in But there is some issue in Docusaurus too because the error was due to |
Yeah, the chalk error only shows up when SSR throws because of some other error. It doesn't reproduce consistently, so I can't say what's wrong (I haven't seen it myself in SSR failures in a while). Hopefully, when we emit ESM code during SSR (which will not be very distant), this will be gone since we won't worry about all the interop mess :) If it's fixed, can I close this now? I'd like the folks who joined this thread to give a confirmation that the latest patch fixes everything. |
Seems to be ok with 1.0.4 of redocusaurus, my project now builds ok. |
We are having the same problem when moving our code to a version of docusaurus > than beta.18. SSR builds to 92%, then:
We do not use redocusaurus, but we do use another OpenAPI Module called RapiDoc (wrapped in BrowserOnly). |
From rohit-gohri/redocusaurus#178, it looks like @rohit-gohri fixed it by adding the |
I wish I could give more useful information. We have All I can say for sure is our build breaks when upgrading from beta.18 -> beta.19 or beta.20. No other changes on our side. Maybe another plugin or customization is involved or even the cause, but upgrading docusaurus triggers the problem and apparently it doesn't only happen for projects using redocusaurus. |
@Josh-Cena, after some testing, I believe that our builds start failing at 0.0.0-4875 with the |
@sserrata If you are interested in investigating further, you can try replacing |
@Josh-Cena Yes, that appears to have fixed the error. With that fix I was able to work my way up to 0.0.0-4893 before encountering a new error in 0.0.0-4894: Attempted import error: 'decodedMap' is not exported from '@jridgewell/gen-mapping' (imported as 'decodedMap').
Attempted import error: 'encodedMap' is not exported from '@jridgewell/gen-mapping' (imported as 'encodedMap').
TypeError: Cannot read properties of undefined (reading 'split') |
@Josh-Cena, taking a stab in the dark but any chance the source of the error could be the |
Thanks @Josh-Cena: changing this line fixes the build errors for me. Site builds normal in beta.20 now locally, doesn't fix the pipeline of course. |
I just wanted to chime in and say that I'm using https://github.com/stoplightio/elements/, and I'm running into the same issue discussed here! |
I'm another user of Stoplight Elements with this issue. |
I think the culprit here is indeed about the I'm going to avoid using |
I think the polyfill is only replacing the |
In any case, I've merged #7453 which avoids using some "risky" globals in SSR. I'm hoping 0.0.0-5034 would fix everyone's errors; I don't really want to think too deeply about this😄 |
Works for me ❤️ |
Great! Seems we've already have success stories from the majority, either because of @rohit-gohri's fix or from #7453. Specifically, I hope that the following errors no longer appear after using Canary:
I'm going to close this as resolved then. If there are any lingering errors just let me know below, and we can take another look. |
do we need to wait a new release to get the fix? is there a patch package for this? |
Please use the canary release. (We have been talking about canary a lot above) |
Works for our plugin as well! Thanks again for everyone's help! 🥳 |
I was getting the the problem was this polyfill code which I had in a component definition file after the initial imports (so run on the server)
I fixed it by updating it to
guess it makes sense that tried updating the canary version too, but that didn't work as the error was in my own code. #7456 covers the issue, I think |
I'm still experiencing this issue. Tried UPDATE: In my case, only one version of both chalk and tslib was installed, and exactly the versions
That helped in getting the actual SSR error, at least. |
I just tried upgrading Redux Toolkit's website from
edit Hmm. After going into
except that seems to be internal to Docusaurus and I have no idea why that provider doesn't exist. so, three problems here:
*edit 2 And confirmed that I'm seeing the same build failures in CI: |
@markerikson Could you open a new issue or ask in discussions? This issue has been resolved as a plugin polyfilling issue, so yours is probably unrelated. There are many, many things that can cause the |
@Josh-Cena ok, will do! |
Leaving it here for fellow Googlers: I was seeing this error because I had a `style="just-some-string-here" attribute in my .md file: <p style="background-color: #ebf3e6; width: 100%; height: 150px"></p> I did the same that @markerikson did here which resulted in the following build error:
I went on searching for Thanks Mark for the initial hint! |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
While upgrading our project to from Docusaurus v2.0.0-beta.18 to v2.0.0-beta.19 we are now encountering an issue during the build.
Reproducible demo
No response
Steps to reproduce
npm i @docusaurus/[email protected] @docusaurus/[email protected] @docusaurus/[email protected]
from v2.0.0-beta-18npm run build
Expected behavior
To have no problems building. The
chalk_1.default.bold
TypeError doesn't seem related to any breaking changes introduced in the beta-19 version and there are no existing related issues either.Actual behavior
To upgrade, we ran
npm i @docusaurus/[email protected] @docusaurus/[email protected] @docusaurus/[email protected]
.Then when running
npm run build
we run into the below output:Apologies for not creating a reproducible demo, if that's necessary to get this looked at then we can potentially schedule it into our work flow but we've spent a good amount of work time trying to debug this already. Thanks in advance if you're able to provide any insights!
Your environment
Self-service
The text was updated successfully, but these errors were encountered: