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

async-requires.js relative includes broken since #18973 #19931

Closed
jrestall opened this issue Dec 3, 2019 · 6 comments · Fixed by #20169
Closed

async-requires.js relative includes broken since #18973 #19931

jrestall opened this issue Dec 3, 2019 · 6 comments · Fixed by #20169
Assignees
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@jrestall
Copy link

jrestall commented Dec 3, 2019

Description

After the changes made in #18973, specifically these lines, my website no longer builds successfully.

This is because async-requires.js previously imported components like this, which worked great:

  "component---cache-page-templates-example-jsx": () => import("C:\\git\\nexus-ui\\website\\.cache\\page-templates\\example.jsx" /* webpackChunkName: "component---cache-page-templates-example-jsx" */),

After the recent change, components are now imported like this:

"component---cache-page-templates-example-jsx": () => import("page-templates/example.jsx" /* webpackChunkName: "component---cache-page-templates-example-jsx" */),

It works if I change it to import files using ./ at the start:

import("./page-templates/example.jsx" /* webpackChunkName: "component---cache-page-templates-example-jsx" */)

The templates are dynamically generated so need to be in the cache folder so that they get cleaned up during gatsby clean.

Steps to reproduce

  1. Create a page using a component path that is within the /.cache/ folder. e.g. createPage({component: "C:\\git\\website\\.cache\\page-templates\\example.jsx"})
  2. Run gatsby build.

Expected result

Successful build.

Actual result

ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Can't resolve 'page-templates/example.jsx' in 'C:\git\nexus-ui\website\.cache'

File: .cache\async-requires.js

Environment

System:
OS: Windows 7
CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
Binaries:
Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.10.0 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 2.7.15

@wardpeet

@jaymdq
Copy link

jaymdq commented Dec 3, 2019

Having the same problem

@Atr0p
Copy link

Atr0p commented Dec 10, 2019

Also with gatsby-plugin-i18next

@jrestall
Copy link
Author

jrestall commented Dec 11, 2019

Can this please be triaged. It seems to have been missed and is breaking existing sites that were working fine.

/cc @wardpeet @pieh @freiksenet @sidharthachatterjee

@R1cro
Copy link

R1cro commented Dec 11, 2019

@Atr0p got the same issue with gatsby-plugin-i18next when gatsby build...

Generating JavaScript bundles failed

Can't resolve '@wapps/redirect.js' in '../.cache'

File: .cache/async-requires.js

@wardpeet @pieh @freiksenet could you kindly take a look?

@R1cro
Copy link

R1cro commented Dec 11, 2019

I made downgrade to

"gatsby": "2.16.5",

...and it resolved my issue.

CC: @jrestall, @Atr0p

@LekoArts LekoArts added the type: bug An issue or pull request relating to a bug in Gatsby label Dec 16, 2019
@vladar
Copy link
Contributor

vladar commented Dec 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants