content: [@nuxt/content-theme-docs] Global components don't work on Windows

Version

@nuxt/content: 1.5.3 @nuxt/content-theme-docs: 0.3.1 nuxt: 2.14

Node 14.7 Windows 10

Reproduction Link

Repo created using npx create-nuxt-app and content module + docs theme.

https://github.com/adrianschubek/orm-ts-docs/tree/bug

Component in /components/global/Test.vue

<template>
  <div>
    This is a test
  </div>
</template>

<script>
export default {

}
</script>

<style scoped>

</style>

Markdown in /content/en/test.md

---
title: 'Introduction'
description: 'Empower your NuxtJS application with this awesome module.'
position: 1
category: 'Getting started'
version: 1.4
fullscreen: false
menuTitle: 'Intro'
---

Introducing my awesome Nuxt module!f

<alert type="info">

Check out a warning alert with a `codeblock`!

</alert>

<test></test>

Steps to reproduce

  1. Clone the repo
  2. npm i && npm run dev
  3. Go to http://localhost:3000/
  4. Click Intro or visit http://localhost:3000/test --> Error

What is Expected?

image

What is actually happening?

Visiting http://localhost:3000/test directly or refreshing the page will result in the following. However when going to http://localhost:3000/ and clicking the sidebar navigation link it works.

image

image

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

I have same problem, and i found the problem in .nuxt\components\plugin.js maybe, but don’t know reason.

Version

@nuxt/content-theme-docs: 0.5.2 nuxt: 2.14.3

Node 12.16.3 Windows 7

Manual operation delete webpackChunkName windows path and it work

// in \.nuxt\components\plugin.js file

IconGithubTest: () => import('../..\\components\\global\\icon\\IconGithubTest.vue' /* webpackChunkName: "D:_Projects/test-doc/components/global/icon/IconGithubTest" */).then(c => c.default || c)
// change to this
IconGithubTest: () => import('../..\\components\\global\\icon\\IconGithubTest.vue' /* webpackChunkName: "components/global/icon/IconGithubTest" */).then(c => c.default || c)