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

[bug] import("foo.module.css") return wrong promise #888

Open
stormslowly opened this issue Jan 22, 2024 · 4 comments · May be fixed by #891
Open

[bug] import("foo.module.css") return wrong promise #888

stormslowly opened this issue Jan 22, 2024 · 4 comments · May be fixed by #891
Labels
bug Something isn't working

Comments

@stormslowly
Copy link
Member

stormslowly commented Jan 22, 2024

problem

related: #866

// index.module.css
.some {
   color: red
}
// index.js
import("./index.module.css")
.then(x=>{
  console.log(x)
})

期望输出(webpack):

{
  "default": {
    "some-xxx": "YO0yo9FyveEuqauRHO3B"
  },
  __esModule: true
}

实际输出(mako): [undefined, undefined]

root cause

// `import('./xxx.css')` => `__mako_require__.ensure('./xxx.css')`

ensure 完了之后,还得 then 下去 require

@stormslowly stormslowly added the bug Something isn't working label Jan 22, 2024
@sorrycc
Copy link
Member

sorrycc commented Jan 22, 2024

有业务这么在用?css 也要走按需么?

@stormslowly
Copy link
Member Author

stormslowly commented Jan 22, 2024

issued by you ref: #754

略有不同的,这个 case 里面的是 css module。

@stormslowly
Copy link
Member Author

css 按需有的。module css 按需不是很明确,but webpack 的行为是符合预期的。

@sorrycc
Copy link
Member

sorrycc commented Jan 22, 2024

是 Bug 但优先级不高。

@stormslowly stormslowly linked a pull request Jan 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants