codesandbox / codesandbox-client

An online IDE for rapid web development
https://codesandbox.io
Other
13.13k stars 2.29k forks source link

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

Open pointhalo opened 1 month ago

pointhalo commented 1 month ago

🐛 bug report

Preflight Checklist

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 commented 1 month ago

Same

filipelima18 commented 1 month ago

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 commented 1 month ago

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

DaiQiangReal commented 1 month ago

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 commented 1 month ago

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/mdx@3.0.1
│     ├─┬ remark-rehype@11.1.1
│     │ ├─┬ mdast-util-to-hast@13.2.0
│     │ │ └── vfile@6.0.3 
│     │ └── vfile@6.0.3 
│     ├─┬ unified@11.0.5
│     │ └── vfile@6.0.3 
│     └── vfile@6.0.3

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

pointhalo commented 1 month ago

image

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

CompuIves commented 1 month ago

This is on my radar. I will find this week some time to investigate this!

On Tue, Oct 8 2024 at 05:07, pointhalo < @.*** > wrote:

image.png (view on web) ( https://github.com/user-attachments/assets/6c82f62c-1c99-4088-bac8-ca98c33821a2 )

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

— Reply to this email directly, view it on GitHub ( https://github.com/codesandbox/codesandbox-client/issues/8625#issuecomment-2399663439 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAEPKCCIOSPPWJZOJAARSQTZ2PDH3AVCNFSM6AAAAABPCR7GRKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJZGY3DGNBTHE ). You are receiving this because you commented. Message ID: <codesandbox/codesandbox-client/issues/8625/2399663439 @ github. com>

filipelima18 commented 1 month ago

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!