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

Sandbox can't recognize Subpath imports, compile fail when import npm package which use this syntax #8625

Open
1 of 3 tasks
pointhalo opened this issue Sep 30, 2024 · 8 comments

Comments

@pointhalo
Copy link

pointhalo commented Sep 30, 2024

🐛 bug report

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project
    adheres to.
  • I have searched the issue tracker for an issue that matches the one I want
    to file, without success.

Description of the problem

How has this issue affected you? What are you trying to accomplish?

To Reproduce

  1. sandbox can't recognize Subpath imports (https://nodejs.org/api/packages.html#subpath-imports)
    image

  2. please see this demo: https://codesandbox.io/p/sandbox/vfile-pure-3xfl7w?file=%2Fsrc%2Findex.mjs%3A16%2C1

The new version vfile use this syntax, codesandbox can't preview it.

image

Link to sandbox: link (optional)

https://codesandbox.io/p/sandbox/vfile-pure-3xfl7w?file=%2Fsrc%2Findex.mjs%3A16%2C1

Your Environment

Software Name/Version
Сodesandbox
Browser
Operating System
@DaiQiangReal
Copy link

Same

@filipelima18
Copy link
Contributor

Hi @pointhalo! I'm sharing the message I've sent you through our Support email here so it can help others too.

Our Sandbox environment does not officially support Node.js. As such, we have introduced support for some critical features such as package management, but we lack feature parity with Node.js. That is also the case with subpath imports.

Still, we are continuously seeking to improve our product, so consider submitting it as a feature request to ensure it is on our product team's radar.

@CompuIves
Copy link
Member

Interesting... is this supported by bundlers like Vite and Webpack? We might need to support this to get parity with them.

@DaiQiangReal
Copy link

Interesting... is this supported by bundlers like Vite and Webpack? We might need to support this to get parity with them.

Webpack and vite support it.

@pointhalo
Copy link
Author

Interesting... is this supported by bundlers like Vite and Webpack? We might need to support this to get parity with them.

In our test, mainstream build tools such as webpack, vite, and rspack are all supported.
We found that the problem is because we are using @mdx-js/mdx to implement markdown rendering. And vfile is the underlying dependency of mdx-js/mdx(After 2024/07/16, the maintainer of vfile updated their version and used this syntax)

There are many people using mdx. If everyone encounters this problem when using mdx-js/mdx in codesandbox, it may be quite troublesome.

│   └─┬ @mdx-js/[email protected]
│     ├─┬ [email protected]
│     │ ├─┬ [email protected]
│     │ │ └── [email protected] 
│     │ └── [email protected] 
│     ├─┬ [email protected]
│     │ └── [email protected] 
│     └── [email protected]

We sincerely hope that your team can consider providing this support🙏

@pointhalo
Copy link
Author

image

And seems i can't reach this circle community page to submit a feature request

@CompuIves
Copy link
Member

CompuIves commented Oct 9, 2024 via email

@filipelima18
Copy link
Contributor

image

And seems i can't reach this circle community page to submit a feature request

This is fixed now and you should be able to access!

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

No branches or pull requests

4 participants