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

broken build with 0.3.0 #301

Closed
pi0 opened this issue May 11, 2021 · 7 comments · Fixed by #305
Closed

broken build with 0.3.0 #301

pi0 opened this issue May 11, 2021 · 7 comments · Fixed by #305
Labels
bug Something isn't working

Comments

@pi0
Copy link
Contributor

pi0 commented May 11, 2021

Version

nuxt: 2.15.5
docus: 0.3.0

Reproduction Link

nuxt/vite@ab49689 (happening in CI)

Error 1:

9:03:14 PM: [error] ENOENT: no such file or directory, open '/opt/build/repo/docs/node_modules/docus/dist/app/static/sw.js'

possible fix: create static/.gitkeep in app directory

Error 2 (fatal):

9:03:19 PM: [fatal] Cannot find the "/opt/build/repo/docs/node_modules/docus/dist/app/tsconfig.json" file.
9:03:19 PM: Please check webpack and ForkTsCheckerWebpackPlugin configuration.
9:03:19 PM: Possible errors:
9:03:19 PM:   - wrong `context` directory in webpack configuration (if `configFile` is not set or is a relative path in the fork plugin configuration)
9:03:19 PM:   - wrong `typescript.configFile` path in the plugin configuration (should be a relative or absolute path)
9:03:19 PM:   Please check webpack and ForkTsCheckerWebpackPlugin configuration.
9:03:19 PM:   Possible errors:
9:03:19 PM:   - wrong `context` directory in webpack configuration (if `configFile` is not set or is a relative path in the fork plugin configuration)
9:03:19 PM:   - wrong `typescript.configFile` path in the plugin configuration (should be a relative or absolute path)
9:03:19 PM:   at Object.assertTypeScriptSupport (node_modules/fork-ts-checker-webpack-plugin/lib/typescript-reporter/TypeScriptSupport.js:40:15)
9:03:19 PM:   at ForkTsCheckerWebpackPlugin.apply (node_modules/fork-ts-checker-webpack-plugin/lib/ForkTsCheckerWebpackPlugin.js:44:33)
9:03:19 PM:   at Object.webpack [as default] (node_modules/webpack/lib/webpack.js:51:13)
9:03:19 PM:   at node_modules/@nuxt/webpack/dist/webpack.js:2056:51
9:03:19 PM:   at Array.map (<anonymous>)
9:03:19 PM:   at WebpackBundler.build (node_modules/@nuxt/webpack/dist/webpack.js:2055:37)
9:03:19 PM:   at async Builder.build (node_modules/@nuxt/builder/dist/builder.js:327:5)
9:03:19 PM:   at async ensureBuild (node_modules/@nuxt/cli/dist/cli-generate.js:145:3)
9:03:19 PM:   at async Object.run (node_modules/@nuxt/cli/dist/cli-generate.js:283:7)
9:03:19 PM:   at async NuxtCommand.run (node_modules/@nuxt/cli/dist/cli-index.js:413:7)

Possible fix: Avoid using @nuxt/typescript-build. Using either siroc or mkdist, you might convert ts files to js artifacts. This still keeps types while removing all typescript overhead (at least for nuxt2 which is via webpack loader instead of esbuild)

Alternatives (not recommended): Create and distribute tsconfig.json file or disable typeCheck option

@pi0 pi0 added the bug Something isn't working label May 11, 2021
@pi0 pi0 changed the title ENOENT: no such file or directory, open '/opt/build/repo/docs/node_modules/docus/dist/app/static/sw.js' ENOENT: no such file or directory, open '.../node_modules/docus/dist/app/static/sw.js' May 11, 2021
@pi0 pi0 changed the title ENOENT: no such file or directory, open '.../node_modules/docus/dist/app/static/sw.js' broken build with 0.3.0 May 11, 2021
@Tahul
Copy link
Contributor

Tahul commented May 11, 2021

Hey @pi0 🙂

Thanks for this issue, I will fix these soon.

As Docus evolved and is currently under active development, the v0.3.0 includes few updates that needs a refactor of current projects using it.

I will sent a PR on nuxt/vite right away, including these changes.

Would you mind giving me a list of projects you have using Docus so I can do the same on each?

Thank you a lot 🙏

@pi0
Copy link
Contributor Author

pi0 commented May 11, 2021

Thanks for quick response. I will share more as recall (nuxt/http is using docus too).

But I think it would be nicer if you can fix them in upstream (typescript dist is not really an ideal solution. please let me know if needing help)

@pi0
Copy link
Contributor Author

pi0 commented May 11, 2021

Update: nuxt/image is also using docus

@Tahul
Copy link
Contributor

Tahul commented May 11, 2021

Thanks for updates 🙂;

We will need to fix the issues you reported upstream for sure!

Even with these issues fixed, the Docus core has been updated and so the projects using it will at least need an update PR.

That is also a good opportunity to fix other issues inside Docus with feedback from theses repositories!

I'm currently working on update of nuxt/vite docs, and already spotted few caveats that will also need to be fixed upstream.

I think it will take some time though, is waiting for the next release before updating Docus okay?

I would appreciate help on the tsconfig.json issue, what would be your recommandations about that, could this be fixed easily from my siroc.config?

Thank you a lot for your help on this @pi0 🙏

@pi0
Copy link
Contributor Author

pi0 commented May 11, 2021

Sure! We can do end to end testing using this repos. And no worries for now i pinned to 0.1.x (tailwind/jit dep is needed but that's okay).

Will open a PR tomorrow for ts dist fix :)

@Tahul
Copy link
Contributor

Tahul commented May 12, 2021

Update: https://tailwindcss.nuxtjs.org also uses Docus

@pi0
Copy link
Contributor Author

pi0 commented May 12, 2021

Moved to #303

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
Development

Successfully merging a pull request may close this issue.

2 participants