previewjs icon indicating copy to clipboard operation
previewjs copied to clipboard

JSX inside .js fails within the previewjs repo

Open fwouts opened this issue 1 year ago • 0 comments

For example, https://github.com/fwouts/previewjs/blob/849fa886c7c3b4539a5fcee015d93f0aa65128f8/framework-plugins/react/tests/apps/cra-js/src/App.js#L4 cannot be rendered in Preview.js.

This happens across VS Code and CLI.

Screenshot 2023-04-28 at 10 35 49 am

However, smoke tests work fine for this directory. It appears this is because smoke tests duplicate the directory outside of the monorepo. This is confirmed by moving the directory out, and confirming that Preview.js works again.

There must therefore be some broken mechanism that disables JSX source transformation based on a parent directory. I haven't quite figured out what the source of the bug is.

This seems low priority as it may only occur inside the previewjs repo, but if you see this bug happening in your own codebase, please comment below.

fwouts avatar Apr 28 '23 00:04 fwouts