You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting a build error when I compile with 2 plugins in the same config
redocusaurus 1.3.0
docusaurus-theme-search-typesense 0.7.0-0
I also wanted to note that I only run into this error when running npm run build if i do npm start everything works fine with both plugins available in the docusaurus config.
I've tried a mix of the following
rm -rf node_modules package-lock.json and reinstall
downgrading docusaurus to v2.0.1
upgrading to docusaurus v2.1.0
I've noticed that if I were to comment out the redocusaurus config in presets of docusaurus.config.js OR themes:['docusaurus-theme-search-typesense'] the build happens smoothly
[INFO] [en] Creating an optimized production build...
✔ Client
✖ Server
Compiled with some errors in 15.89s
main:55529
{}.DEBUG = namespaces;
^
SyntaxError: Unexpected token '.'
[ERROR] Unable to build website for locale en.
[ERROR] Error: Failed to compile with errors.
at .../json-api-docs/node_modules/@docusaurus/core/lib/webpack/utils.js:180:24
at .../json-api-docs/node_modules/webpack/lib/MultiCompiler.js:554:14
at processQueueWorker (.../json-api-docs/node_modules/webpack/lib/MultiCompiler.js:491:6)
at processTicksAndRejections (node:internal/process/task_queues:78:11)
[INFO] Docusaurus version: 2.1.0
Node version: v16.14.2
Steps to reproduce
implement redocusaurus
implement searchbar utilizing typesense
npm run build with both redocusaurus and docusaurus-theme-search-typesense enabled in the docusaurus config
Expected Behavior
I would expect the build to be successful / compete
Actual Behavior
Build fails when compiling the "server"
Metadata
Typsense Version:
0.7.0-0
OS:
MacOS Monterey 12.6
The text was updated successfully, but these errors were encountered:
A PR which fixed this issue with minimal changes was rejected with the justification that "it wasn't the maintainers' job to fix other people's messes". Another PR which may fix this issue has been open for more than four years.
The original issue offers several possible workarounds by defining webpack plugins but I'm not sure these can be added to a Docusaurus project.
One of my coworkers suggested simply commenting out the offending line in the node_modules folder (node_modules/debug/src/node.js):
functionsave(namespaces){if(namespaces){// process.env.DEBUG = namespaces;}else{// If you set a process.env field to null or undefined, it gets cast to the// string 'null' or 'undefined'. Just delete instead.deleteprocess.env.DEBUG;}}
Which, while being an incredibly hacky solution, is the one we currently use as part of our CI pipeline by running the following sed command after installing npm packages:
sed -i '/process.env.DEBUG = namespaces;/c\// process.env.DEBUG = namespaces;' ./node_modules/debug/src/node.js
Far from ideal, I know, but I hope it helps someone until the root cause is fixed.
Description
Hi
I'm getting a build error when I compile with 2 plugins in the same config
I also wanted to note that I only run into this error when running
npm run build
if i donpm start
everything works fine with both plugins available in the docusaurus config.I've tried a mix of the following
I've noticed that if I were to comment out the redocusaurus config in presets of
docusaurus.config.js
ORthemes:['docusaurus-theme-search-typesense']
the build happens smoothlydocusaurus.config.js
package.json
error message
Steps to reproduce
npm run build
with both redocusaurus and docusaurus-theme-search-typesense enabled in the docusaurus configExpected Behavior
Actual Behavior
Metadata
Typsense Version:
0.7.0-0
OS:
MacOS Monterey 12.6
The text was updated successfully, but these errors were encountered: