nuxtent-module icon indicating copy to clipboard operation
nuxtent-module copied to clipboard

multiple-content-types example doesn't work

Open sandrosc opened this issue 7 years ago • 17 comments

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)

sandrosc avatar Dec 28 '17 00:12 sandrosc

@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 avatar Jan 09 '18 07:01 andrevandal

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

andrevandal avatar Jan 09 '18 08:01 andrevandal

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

sandrosc avatar Jan 09 '18 10:01 sandrosc

@derevandal thx for the tip!

sandrosc avatar Jan 09 '18 10:01 sandrosc

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

andrevandal avatar Jan 09 '18 11:01 andrevandal

@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

alidcast avatar Jan 09 '18 13:01 alidcast

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

andrevandal avatar Jan 09 '18 18:01 andrevandal

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

eduplessis avatar May 16 '18 13:05 eduplessis

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?

sebstr1 avatar Aug 29 '18 07:08 sebstr1

@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.

renestalder avatar Aug 29 '18 08:08 renestalder

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

sebstr1 avatar Aug 29 '18 08:08 sebstr1

@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...

sebstr1 avatar Aug 29 '18 09:08 sebstr1

@sebstr1 Linux. (Arch)

renestalder avatar Aug 29 '18 12:08 renestalder

@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.

renestalder avatar Aug 29 '18 12:08 renestalder

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.

sebstr1 avatar Aug 29 '18 16:08 sebstr1

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

cesasol avatar Aug 29 '18 18:08 cesasol

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.

channeladam avatar Oct 07 '18 12:10 channeladam