million icon indicating copy to clipboard operation
million copied to clipboard

bug: Typescript files are not being compiled, when I add million.webpack() to my webpack 5 configuration

Open TerrySlack opened this issue 1 year ago • 1 comments

Describe the bug When I add million.webpack() to my webpack configuration, typescript files are not being compiled. I have followed the suggestion in the docs, and changed all of my interfaces to types. *.d.ts files generate

Millions-type-files

When I comment out the *.d.ts files, I get the first TypeScript error

TypeScript-Error

To Reproduce Steps to reproduce the behavior:

  1. Add million.js to package.json
  2. Import the million compiler into webpack.config
    using const million = require("million/compiler");
  3. add million.compiler to the plugins array in webpack
    plugins: [  million.webpack() ]
}
  1. compile the project with yarn dev

Expected behavior TypeScript files are transpiled, and the app is launced successfully

Screenshots Added above

Device (please complete the following information): -Windows 11

  • Browser: chrome, msedge, firefox. But the project does not compile so this is moot
  • Versions:
 "million": "^2.4.9",
 "react": "^18.2.0",
 "react-dom": "^18.2.0",
 "react-router-dom": "^6.14.1",
 "typescript": "^5.1.6",
 "webpack": "^5.88.1",
 "webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",

I hope this is me missing something and it's a simple fix on how I've set things up on my end.
Removing million.compiler from the webpack configuration, the project compiles and works in the browser successfully.

TerrySlack avatar Jul 08 '23 21:07 TerrySlack

Having a similar problem using vite and TS here

lucasluca avatar Jul 09 '23 18:07 lucasluca

Having a similar problem using vite and TS here

Hmm, thank you very much @TerrySlack and @lucasluca. We'll have a look at this and let you know very soon what could be causing it.

tobySolutions avatar Jul 11 '23 09:07 tobySolutions

Just released a fix @TerrySlack and @lucasluca, please retry with 2.5.0. If the issue is fixed, would be awesome if you closed the issue. Otherwise, ping me again

aidenybai avatar Jul 14 '23 04:07 aidenybai

Hi @aidenybai Sorry for the delay. tried with both v2.5.0 and latest which installed 2.5.2-beta.0 and get the following errors.
million-error

As mentioned above, using windows 11, VS Code and:

"million": "^2.5.2-beta.0",
"typescript": "^5.1.6",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",

TerrySlack avatar Jul 26 '23 19:07 TerrySlack