{"id":21146347,"url":"https://github.com/bhallstein/vite-jsx-in-node-modules-issue","last_synced_at":"2025-03-14T13:44:19.934Z","repository":{"id":143863297,"uuid":"605717219","full_name":"bhallstein/vite-jsx-in-node-modules-issue","owner":"bhallstein","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-23T18:50:25.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T07:42:43.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bhallstein.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-23T18:50:16.000Z","updated_at":"2023-02-23T18:50:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"895c16c8-4158-4225-a73e-cbaca10a4408","html_url":"https://github.com/bhallstein/vite-jsx-in-node-modules-issue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhallstein%2Fvite-jsx-in-node-modules-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhallstein%2Fvite-jsx-in-node-modules-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhallstein%2Fvite-jsx-in-node-modules-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhallstein%2Fvite-jsx-in-node-modules-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhallstein","download_url":"https://codeload.github.com/bhallstein/vite-jsx-in-node-modules-issue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243589287,"owners_count":20315467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T08:52:39.157Z","updated_at":"2025-03-14T13:44:19.909Z","avatar_url":"https://github.com/bhallstein.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vite NPX in node_modules issue\n\nIn this repo, trying to persuade Vite to compile a jsx file located inside a node_modules file. In vite.config.js, `optimizeDeps.include` is `['jsx-dep']`, but this has no effect.\n\nVite outputs an error message saying to change the file extension of the included file to 'jsx', but the file already has this extension.\n\nSteps to reproduce:\n\n- Clone this repo\n- `npm install`\n- `git checkout .`  -- re-adds the `jsx-dep` dep inside node_modules\n- `npx vite`\n\nError message:\n\n```\nsx extension.\n18:46:07 [vite] Internal server error: Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.\n  Plugin: vite:import-analysis\n  File: /Users/ben/Desktop/vite-jsx-test/node_modules/jsx-dep/index.jsx:5:11\n  3  |      \u003cdiv\u003e\n  4  |        Hello\n  5  |      \u003c/div\u003e\n     |            ^\n  6  |    )\n  7  |  }\n      at formatError (file:///Users/ben/Desktop/vite-jsx-test/node_modules/vite/dist/node/chunks/dep-ca21228b.js:41418:46)\n      at TransformContext.error (file:///Users/ben/Desktop/vite-jsx-test/node_modules/vite/dist/node/chunks/dep-ca21228b.js:41414:19)\n      at TransformContext.transform (file:///Users/ben/Desktop/vite-jsx-test/node_modules/vite/dist/node/chunks/dep-ca21228b.js:39641:22)\n      at async Object.transform (file:///Users/ben/Desktop/vite-jsx-test/node_modules/vite/dist/node/chunks/dep-ca21228b.js:41685:30)\n      at async loadAndTransform (file:///Users/ben/Desktop/vite-jsx-test/node_modules/vite/dist/node/chunks/dep-ca21228b.js:39479:29)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhallstein%2Fvite-jsx-in-node-modules-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhallstein%2Fvite-jsx-in-node-modules-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhallstein%2Fvite-jsx-in-node-modules-issue/lists"}