Skip to content
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

Build error - additionalLanguages #183

Closed
AlexisTonneau opened this issue May 24, 2022 · 13 comments
Closed

Build error - additionalLanguages #183

AlexisTonneau opened this issue May 24, 2022 · 13 comments

Comments

@AlexisTonneau
Copy link

Is anyone experiencing this error? I cannot perform a build anymore. I tried with different schema types and different versions but it didn't succeed

[ERROR] Docusaurus server-side rendering could not render static page with path "/api/".

TypeError: Cannot set properties of undefined (setting 'triple-quoted-string')
[ERROR] Unable to build website for locale en.
[ERROR] Error: Failed to compile with errors.
@rohit-gohri
Copy link
Owner

Can you tell which version of docusaurus and redocusaurus are you using?

@AlexisTonneau
Copy link
Author

@docusaurus/core: 2.0.0-beta.20"
@docusaurus/preset-classic: 2.0.0-beta.20
redocusaurus: 1.1.0

@Leander-van-Boven
Copy link

Leander-van-Boven commented May 31, 2022

I've also encountered this error, although for me the error was visible from the browser console, while the viewport was just an empty white page.

I already looked a bit into this, and I found out, it did not get this error when not specifying any additionalLanguages in prism config in docusaurus.config.js:

themeConfig: {
  prism: {
    additionalLanguages: []
  }
}

For me this 'solved' the problem, however, because I need syntax highlighting for languages not enabled by default in Prism, I sadly will have to hold off on Redocusaurus until this problem is fixed.

@rohit-gohri
Copy link
Owner

Can you add the error and stacktrace from the browser? Also your problem might be fixed by this comment: #68 (comment)

Maybe we should merge language settings and always add scala

@Leander-van-Boven
Copy link

Thanks, this solved the problem for me.
Without 'scala' in the additionalLanguages this is the browser error + stack trace:
image

@rohit-gohri
Copy link
Owner

@AlexisTonneau Are you also using additionalLanguages ?

@rohit-gohri rohit-gohri changed the title Build error Build error - additionalLanguages May 31, 2022
@rohit-gohri
Copy link
Owner

rohit-gohri commented May 31, 2022

Can you remove the scala language and try version v1.1.1 @Leander-van-Boven ? It should automatically add scala lang

@AlexisTonneau
Copy link
Author

Yes, I added java in additionalLanguages property

@rohit-gohri
Copy link
Owner

@AlexisTonneau Does 1.1.1 fix your issue?

@AlexisTonneau
Copy link
Author

AlexisTonneau commented Jun 2, 2022

No it doesn't. I noticed that it doesn't look to be related to prisma issue.

When I run docusaurus start, I get this issue on the website page (which wasn't the case in previous version):

Hook useColorMode is called outside the <ColorModeProvider>. Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.

But when I run docusaurus build, I get this error:

[ERROR] Docusaurus server-side rendering could not render static page with path "/api/".

ReactContextError
[ERROR] Unable to build website for locale en.
[ERROR] Error: Failed to compile with errors.
    at /Users/atonneau/Projects/onets/node_modules/@docusaurus/core/lib/webpack/utils.js:182:24
    at /Users/atonneau/Projects/onets/node_modules/webpack/lib/MultiCompiler.js:554:14
    at processQueueWorker (/Users/atonneau/Projects/onets/node_modules/webpack/lib/MultiCompiler.js:491:6)
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

@rohit-gohri
Copy link
Owner

That is same as #174. Will see

@rohit-gohri
Copy link
Owner

Additional languages fixed in #187 and #174 fixed in #206

@saul-data
Copy link

I had the same issue with version 2.0.2

I added in java as an additional language. The fix was to add scala too.

      prism: {
        theme: prismThemes.github,
        darkTheme: prismThemes.dracula,
        additionalLanguages: ["bash", "csharp", "java", "php", "ruby", "scala"],
      },

Error:

Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'triple-quoted-string')
    at Object.extend (prism.js:345:16)
    at eval (prism-scala.js:1:41)
    at ./node_modules/prismjs/components/prism-scala.js (vendors-node_modules_docusaurus-theme-redoc_dist-jsx_theme_ApiDoc_index_js.js:2105:1)
    at __webpack_require__ (runtime~main.js:34:32)
    at fn (runtime~main.js:334:21)
    at eval (redoc.browser.lib.js:41:12173)
    at eval (redoc.browser.lib.js:1819:3806)
    at eval (redoc.browser.lib.js:1819:3811)
    at eval (redoc.browser.lib.js:2:37)
    at eval (redoc.browser.lib.js:2:43)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants