nuxt-community / nuxtent-module

Seamlessly use content files in your Nuxt.js sites.
https://nuxtent-module.netlify.com/guide
MIT License
388 stars 50 forks source link

multiple-content-types example doesn't work #129

Open sandrosc opened 6 years ago

sandrosc commented 6 years ago

I tried to run several examples locally, some didn't work as soon as you click a link. The following is the output of the multiple-content-types example.

C:\git\nuxtent-module\examples\multiple-content-types>yarn dev
yarn run v1.2.1
warning You are using Node "9.3.0" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || ^8.0.0"
warning package.json: No license field
$ nuxt
  nuxt:axios BaseURL: http://localhost:3000/content-api (Browser: /content-api) +0ms
  nuxt:build App root: C:\git\nuxtent-module\examples\multiple-content-types +0ms
  nuxt:build Generating C:\git\nuxtent-module\examples\multiple-content-types\.nuxt files... +1ms
  nuxt:build Generating files... +35ms
  nuxt:build Generating routes... +9ms
  nuxt:build Building files... +113ms
  nuxt:build Adding webpack middleware... +120ms
Build completed in 6.388s

 DONE  Compiled successfully in 6392ms

 OPEN  http://localhost:3000

  nuxt:render Rendering url / +0ms
  nuxt:render Data fetching /: 1ms +0ms
  nuxt:render Rendering url /content-api/posts/2015/first-post? +21s
{ statusCode: 404, message: 'This page could not be found' }
  nuxt:render Rendering url / +5s
  nuxt:render Data fetching /: 0ms +26s
  nuxt:render Rendering url /content-api/posts/projects/ency? +2s
{ statusCode: 404, message: 'This page could not be found' }
  nuxt:render Rendering url / +4s
  nuxt:render Data fetching /: 0ms +6s
  nuxt:render Rendering url /content-api/posts/projects/ency? +1s
{ statusCode: 404, message: 'This page could not be found' }

I am on Windows 10, Node 9.3.

This bug report is available on Nuxt.js community (#c103)
andrevandal commented 6 years ago

@alidcastano i tried build your site and i got this error:

ERROR Failed to compile with 1 errors 05:31:54

This dependency was not found:

  • ~\content in ./.nuxt/plugins.markdownComponents.4f97e594.js

To install it, you can run: npm install --save ~\content

OPEN http://localhost:3000

in plugins.markdownComponents.4f97e594.js:

importAllMdComps(
  require.context("~\\content", true, /\.comp\.md$/)
)

the error stops when I change to:

importAllMdComps(
  require.context("~/content", true, /\.comp\.md$/)
)

btw, content-api returns

"content-endpoints": [
    "\\now",
    "\\articles",
    "\\projects"
]

I think that we could add some replaces, but i don't know where.

andrevandal commented 6 years ago

@sandrosc use Windows Subsystem for Linux to build your application now. ;)

sandrosc commented 6 years ago

@derevandal afaik the dependencies of his site are out of date, not sure if it's helpful for this bug.

sandrosc commented 6 years ago

@derevandal thx for the tip!

andrevandal commented 6 years ago

@sandrosc I got these error in my personal closed project too and here it works even with this dependency problem.

alidcast commented 6 years ago

@derevandal @sandrosc Thanks for helping to narrow it down for me, ill try to find the time to update module for windows build and then do a quick update to this template as well

andrevandal commented 6 years ago

@alidcastano ok, if u need help and tell me what and where I should do, I can make a PR.

eduplessis commented 6 years ago

That's what I got when trying to run the examples/multiple-content-types

nuxt:render Rendering url /archives +29s nuxt:render Rendering url /content-api//posts/? +2ms { statusCode: 404, path: '/content-api//posts/?', message: 'This page could not be found' }

ERROR

Error: Request failed with status code 404

  • createError.js:16 createError [multiple-content-types]/[axios]/lib/core/createError.js:16:15
  • settle.js:18 settle [multiple-content-types]/[axios]/lib/core/settle.js:18:12
    • http.js:192 IncomingMessage.handleStreamEnd [multiple-content-types]/[axios]/lib/adapters/http.js:192:11
    • events.js:110 emitNone events.js:110:20
    • events.js:207 IncomingMessage.emit events.js:207:7
    • _stream_readable.js:1059 endReadableNT _stream_readable.js:1059:12
    • next_tick.js:138 _combinedTickCallback internal/process/next_tick.js:138:11
    • next_tick.js:180 process._tickCallback internal/process/next_tick.js:180:9
sebstr1 commented 6 years ago

Multiple content types not working at all for me. I've read the docs several times. Everything works well until I change content to be an array instead of an object. Any solution for this?

renestalder commented 6 years ago

@sebstr1 They don't work. Some claim on the development branch it works, but I used the nuxtdown module for now, which has this fixed and works without issues so far. You should be able to easily switch back to nuxtent in case it gets a patched release anytime soon.

sebstr1 commented 6 years ago

@renestalder Thank you, I will look into that instantly!

sebstr1 commented 6 years ago

@renestalder What OS are you using? I seem to have the same issue with nuxtent. Im on Windows 10. Works fine on my linux laptop.

Edit: I take some of that back. the content-api works only on linux. both the path and permalink generated in the content api results in 404

Edit2: The nuxtdown example for multiple content is also not working...

renestalder commented 6 years ago

@sebstr1 Linux. (Arch)

renestalder commented 6 years ago

@sebstr1 I didn't check the xamples at all. Just from the README, I could easily setup multiple content with nuxtdown after switching out the module in the nuxt configuration and changing the nuxtent tags in the Vue templates to nuxtdown.

sebstr1 commented 6 years ago

Ok, after some more fiddeling I figured it out, working on my Linux machine! The same config does not work at all for Windows though.

cesasol commented 6 years ago

We are working on Windows support. A workaround is to use the Linux subsystem on w10

channeladam commented 6 years ago

Might be nice to insert a warning into the README to let people know that it doesn't work on Windows... rather than having people like me wasting hours and thinking it is something they misconfigured.