Next.js: Nested pages have no absolute path reference to static folder

Created on 27 Nov 2019  路  1Comment  路  Source: vercel/next.js

Bug report

Describe the bug

Nested pages have no absolute path reference to the static folder.
If page is not into top-level into pages folder I should replace all static folder references like with the relative path.

To Reproduce

Create nested pages structure inside pages folder like
/home
--/view

Inside view page include for example

System information

  • OS: macOS
  • Browser any
  • Version of Next.js: 9.1.4, file-loader 4.2.0, url-loader 2.0.1

Most helpful comment

You need to reconfigure your custom configuration file/url loaders to handle this, or use the top-level syntax.

Normally, your static assets that were not imported via loader should be referenced like so:

<img src="/static/someimage.jpg />

(note the leading /)

>All comments

You need to reconfigure your custom configuration file/url loaders to handle this, or use the top-level syntax.

Normally, your static assets that were not imported via loader should be referenced like so:

<img src="/static/someimage.jpg />

(note the leading /)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

havefive picture havefive  路  3Comments

ghost picture ghost  路  3Comments

flybayer picture flybayer  路  3Comments

kenji4569 picture kenji4569  路  3Comments

olifante picture olifante  路  3Comments