Skip to content

[Bug]: Cannot find module '@rspress/core/theme' for matched aliased key '@rspress/core' #2633

@spaceychen

Description

@spaceychen

Version

System:
    OS: macOS 13.7.8
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 255.54 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 140.0.7339.210
    Edge: 140.0.3485.94
    Safari: 18.6
  npmPackages:
    rspress: ^2.0.0-beta => 2.0.0-beta.21

Details

Follow this official document, I use the tabs component in test.mdx

import { Tab, Tabs } from '@rspress/core/theme';

<Tabs>
  <Tab label="Tab 1">Tab 1 content</Tab>
  <Tab label="Tab 2">Tab 2 content</Tab>
</Tabs>

but the browser(chrome) report error:

Image

when link to file, running well

import { Tab, Tabs } from '@rspress/core/dist/theme.js';

Is it possible that @ rspress/core/theme was parsed without going through the exports field of packagejson?

Reproduce link

blank

Reproduce Steps

RT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions