Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import custom identifier called css with error "Cannot find module 'linaria'" #739

Closed
GitaiQAQ opened this issue Mar 12, 2021 · 4 comments
Closed
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked bundler: webpack 📦 Issue is related to webpack bundler needs: complete repro 🖥️ Issue need to have complete repro provided

Comments

@GitaiQAQ
Copy link
Contributor

GitaiQAQ commented Mar 12, 2021

Environment

  • Linaria version: After split one linaria package into multiple @linaria/*

Description

When import css from some module like './utils', webpack will throw an error "Cannot find module 'linaria'"

import { css } from './utils';

...

Because the package 'linaria' is deprecated, At here try the resolve this. And then require.resolve will throw an exception.

Example

https://codesandbox.io/s/linaria-demo-forked-rbivr?file=/src/index.js

@GitaiQAQ GitaiQAQ added bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided needs: triage 🏷 Issue needs to be checked and prioritized labels Mar 12, 2021
@github-actions github-actions bot added bundler: webpack 📦 Issue is related to webpack bundler and removed needs: triage 🏷 Issue needs to be checked and prioritized labels Mar 12, 2021
@chrisabrams
Copy link
Contributor

I get the same error when using import { css } from '@linaria/react'.

@Anber
Copy link
Collaborator

Anber commented Mar 20, 2021

Hi @chrisabrams

I get the same error when using import { css } from '@linaria/react'.

css is located in @linaria/core because core is a zero-runtime package, whereas @linaria/react imports a small amount of code for supporting props.

Anber pushed a commit that referenced this issue Mar 20, 2021
…le 'linaria'" #739 (#740)

* fix: Import custom identifier called css with error "Cannot find module 'linaria'"
@Anber Anber closed this as completed Mar 20, 2021
@chrisabrams
Copy link
Contributor

Hi @chrisabrams

I get the same error when using import { css } from '@linaria/react'.

css is located in @linaria/core because core is a zero-runtime package, whereas @linaria/react imports a small amount of code for supporting props.

I blame lack of sleep. Thanks.

@Mavrin
Copy link

Mavrin commented Apr 9, 2021

Could you please publish new package version with fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked bundler: webpack 📦 Issue is related to webpack bundler needs: complete repro 🖥️ Issue need to have complete repro provided
Projects
None yet
Development

No branches or pull requests

4 participants