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

[nextjs] Move the import startsWith next check at end #228

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

brijeshb42
Copy link
Contributor

  • This fixes the resolve error happening in nextjs for it's path based module imports.
  • Also adds check for next/link
  • Ignore null value during css object processing

Fixes #204

* This fixes the resolve error happening in nextjs for it's path based module imports.
* Also adds check for `next/link`
* Ignore null value during css object processing
@brijeshb42 brijeshb42 requested review from siriwatknp and a team September 11, 2024 07:59
@brijeshb42 brijeshb42 requested a review from Janpot September 11, 2024 08:37
Comment on lines 158 to 161
if (!value) {
// ignore null value
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you review this instead #229

@brijeshb42 brijeshb42 merged commit e1c587d into mui:master Sep 11, 2024
12 checks passed
return require.resolve(what);
}
if (what === 'next/image') {
if (what === 'next/image' || what === 'next/link') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If what==='next/link' we still import next-image? @brijeshb42

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both just point to a dummy module for wyw evaluation to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next/link just provides a default export which is already there in the next-image file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK 👌

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a bit confusing 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could just rename the next-image file to next-module-stub or similar to remove the confusion.
It's on our side and not user facing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Importing next/link in async component produces error
4 participants