-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Fix infinite loop when prerendering json imports #480
Conversation
🦋 Changeset detectedLatest commit: 8320de5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
88cd251
to
8320de5
Compare
Size Change: +1.27 kB (0%) Total Size: 694 kB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was quite the saga, haha.
If I am not mistaken, this PR supersedes #458 ? |
const [fetched, setFetched] = useState(null); | ||
|
||
useEffect(() => { | ||
fetch('./pages/foo.json') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought: this feels like a missed opportunity to demonstrate import jsonUrl from 'url:./foo.json';
+ fetch(jsonUrl)
. Otherwise, to the reader the relative path ./pages/foo.json
looks like "magic", in the base context of public/pages/json.js
.
This bug was a combination of multiple smaller issues:
\0json:
twice to paths during resolution\0json:
files properly during prod buildsFixes #446, fixes #474 .