-
Notifications
You must be signed in to change notification settings - Fork 425
Open
Labels
Needs investigationInvestigation is planned but not started yetInvestigation is planned but not started yet
Description
Description
When importing DocSearch
React component in Remix framework web app, following error is thrown when running application:
[vite] Internal server error: [vite] Named export 'DocSearch' not found. The requested module '@docsearch/react' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@docsearch/react';
const {DocSearch} = pkg;
Steps to reproduce
- Create Remix app through
npx create-remix@latest
- Add
DocSearch
import toapp/routes/_index.tsx
:
import { DocSearch } from '@docsearch/react';
import '@docsearch/css';
- Run application in dev mode:
npm run dev
- Visit local page:
http://localhost:5173/
Expected behavior
Error:
Internal server error: [vite] Named export 'DocSearch' not found.
should not be produced when running web app in Remix framework. Instead DocSearch search component should be rendered.
Environment
- OS: Mac
- Browser: Chrome
- DocSearch version: 3.6.0
natew, acusti and slax57
Metadata
Metadata
Assignees
Labels
Needs investigationInvestigation is planned but not started yetInvestigation is planned but not started yet