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

Docusaurus Build fails when using 1.0.0 with Typescript #175

Closed
matthew-west-unity opened this issue Mar 15, 2023 · 6 comments · May be fixed by mdomorffaruk/dispatch#4 or tahabiyikli/dispatch1#2
Closed
Assignees
Labels
bug Something isn't working

Comments

@matthew-west-unity
Copy link

Please describe the bug you are seeing

I've started a new Docusaurus project and when I run docusaurus build with version 1.0.0 of the docusaurus-search-local plugin it fails with the following error:

TypeError: (0 , d_s_l_a_generated_namespaceObject.mylunr) is not a function

And the stack trace:

[ERROR] Unable to build website for locale en.
[ERROR] Error: Failed to compile with errors.
    at C:\MY_PATH\node_modules\@docusaurus\core\lib\webpack\utils.js:180:24
    at C:\MY_PATH\node_modules\webpack\lib\MultiCompiler.js:554:14
    at processQueueWorker (C:\MY_PATH\node_modules\webpack\lib\MultiCompiler.js:491:6)
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

If I use 0.11.0 of this package the build completes successfully.

How can we best reproduce the bug?

No response

Which version of Docusaurus and @cmfcmf/docusaurus-search-local are you using?

+-- @cmfcmf/[email protected]
| `-- @docusaurus/[email protected] deduped
+-- @docusaurus/[email protected]
`-- @docusaurus/[email protected]
  +-- @docusaurus/[email protected] deduped
  +-- @docusaurus/[email protected]
  | `-- @docusaurus/[email protected] deduped
  +-- @docusaurus/[email protected]
  | `-- @docusaurus/[email protected] deduped
  +-- @docusaurus/[email protected]
  | `-- @docusaurus/[email protected] deduped
  +-- @docusaurus/[email protected]
  | `-- @docusaurus/[email protected] deduped
  +-- @docusaurus/[email protected]
  | `-- @docusaurus/[email protected] deduped
  +-- @docusaurus/[email protected]
  | `-- @docusaurus/[email protected] deduped
  +-- @docusaurus/[email protected]
  | `-- @docusaurus/[email protected] deduped
  +-- @docusaurus/[email protected]
  | `-- @docusaurus/[email protected] deduped
  `-- @docusaurus/[email protected]
    `-- @docusaurus/[email protected] deduped

Which Node.js version are you using?

v16.16.0

Which theme are you using?

Yes, I am using @docusaurus/theme-classic

How does your plugin config look like?

plugins: [require.resolve("@cmfcmf/docusaurus-search-local")]

Additional context

No response

@matthew-west-unity matthew-west-unity added the bug Something isn't working label Mar 15, 2023
@Porkalanchiyam
Copy link

I'm also facing the same issue .

@Beluk
Copy link

Beluk commented Mar 22, 2023

Have the same issue.

@cmfcmf cmfcmf self-assigned this Mar 22, 2023
@AamiRobin
Copy link

same issue here.

@cmfcmf
Copy link
Owner

cmfcmf commented Mar 23, 2023

Thank you all for letting me know; I will take a look as soon as possible.

@mariuszkrzaczkowski
Copy link

Have the same issue.

TypeError: (0 , d_s_l_a_generated_namespaceObject.mylunr) is not a function
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"1:1172-1178","message":"export 'mylunr' (imported as 'mylunr') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"client"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"1:2112-2129","message":"export 'mylunr' (imported as 'mylunr') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"client"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"21:553-561","message":"export 'tokenize' (imported as 'tokenize') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"client"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"21:832-862","message":"export 'mylunr' (imported as 'mylunr') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"client"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"21:988-1018","message":"export 'mylunr' (imported as 'mylunr') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"client"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"21:1132-1162","message":"export 'mylunr' (imported as 'mylunr') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"client"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"21:1374-1404","message":"export 'mylunr' (imported as 'mylunr') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"client"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"1:859-865","message":"export 'mylunr' (imported as 'mylunr') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"server"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"5:58-75","message":"export 'mylunr' (imported as 'mylunr') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"server"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"26:236-244","message":"export 'tokenize' (imported as 'tokenize') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"server"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"26:431-461","message":"export 'mylunr' (imported as 'mylunr') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"server"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"26:587-617","message":"export 'mylunr' (imported as 'mylunr') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"server"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"26:731-761","message":"export 'mylunr' (imported as 'mylunr') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"server"}
[WARNING] {"moduleIdentifier":"d:\\www\\YetiForceDoc\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[6].use[0]!d:\\www\\YetiForceDoc\\node_modules\\@cmfcmf\\docusaurus-search-local\\lib\\client\\theme\\SearchBar\\index.js","moduleName":"./node_modules/@cmfcmf/docusaurus-search-local/lib/client/theme/SearchBar/index.js","loc":"26:973-1003","message":"export 'mylunr' (imported as 'mylunr') was not found in './d-s-l-a-generated' (module has no exports)","compilerPath":"server"}
[ERROR] Unable to build website for locale en.
[ERROR] Error: Failed to compile with errors.
    at d:\www\YetiForceDoc\node_modules\@docusaurus\core\lib\webpack\utils.js:180:24
    at d:\www\YetiForceDoc\node_modules\webpack\lib\MultiCompiler.js:554:14
    at processQueueWorker (d:\www\YetiForceDoc\node_modules\webpack\lib\MultiCompiler.js:491:6)
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
[INFO] Docusaurus version: 2.4.0
Node version: v16.17.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

cmfcmf added a commit that referenced this issue Apr 10, 2023
cmfcmf added a commit that referenced this issue Apr 10, 2023
cmfcmf added a commit that referenced this issue Apr 10, 2023
cmfcmf added a commit that referenced this issue Apr 10, 2023
cmfcmf added a commit that referenced this issue Apr 10, 2023
cmfcmf added a commit that referenced this issue Apr 10, 2023
cmfcmf added a commit that referenced this issue Apr 10, 2023
cmfcmf added a commit that referenced this issue Apr 10, 2023
@cmfcmf
Copy link
Owner

cmfcmf commented Apr 10, 2023

Thank you all for reporting this and apologies for the delay! It turns out that the issue was Windows-specific - the d-s-l-a-generated.js file should have been generated with Webpack here:

test: /client\/theme\/SearchBar\/d-s-l-a-generated\.js$/,

However, I didn't realize that Webpack's rules.test option doesn't normalize backslashes and slashes, and so the file wasn't created on Windows.

I fixed this in #180 and will release a new version with this fix shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
6 participants