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

Million lint build error when configuring using webpack (TypeError: Cannot read properties of undefined (reading 'anya')) #1037

Open
uriklar opened this issue May 22, 2024 · 4 comments

Comments

@uriklar
Copy link

uriklar commented May 22, 2024

What version of million are you using?

1.0.0-rc.1

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Mac

What browser are you using?

Chrome

Describe the Bug

In my webpack (v.5.91.0) config I added:

import million from '@million/lint';
plugins: [
     million.webpack(),
     ... other plugins
    ]

And i'm getting this error:

/Users/uriklar/Code/MY_PROJECT/node_modules/unplugin/dist/webpack/loaders/transform.js:104
const plugin = (_a = this._compiler) == null ? void 0 : _a.$unpluginContext[unpluginName];
                                                                          ^

TypeError: Cannot read properties of undefined (reading 'anya')
 at Object.transform (/Users/uriklar/Code/MY_PROJECT/node_modules/unplugin/dist/webpack/loaders/transform.js:104:78)
 at LOADER_EXECUTION (/Users/uriklar/Code/MY_PROJECT/node_modules/loader-runner/lib/LoaderRunner.js:132:14)
 at runSyncOrAsync (/Users/uriklar/Code/MY_PROJECT/node_modules/loader-runner/lib/LoaderRunner.js:133:4)
 at iterateNormalLoaders (/Users/uriklar/Code/MY_PROJECT/node_modules/loader-runner/lib/LoaderRunner.js:251:2)
 at /Users/uriklar/Code/MY_PROJECT/node_modules/loader-runner/lib/LoaderRunner.js:224:4
 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)
 ```

### What's the expected result?

The build to pass

### Link to Minimal Reproducible Example

https://stackblitz.com/sorry-cant-create-one-right-now

### Participation

- [X] I am willing to submit a pull request for this issue.
Copy link

Thanks for opening this issue! A maintainer will review it soon.

@RishabhTayal
Copy link

Same

@ganapativs
Copy link

Same issue here. Please look into this.

/Users/user/project/node_modules/.pnpm/[email protected]/node_modules/unplugin/dist/webpack/loaders/transform.js:105

  if (typeof this.query === "string") {
    console.log(this.query); // ?unpluginName=anya
    const query = new URLSearchParams(this.query);
    unpluginName = query.get("unpluginName");
  } else {
    unpluginName = this.query.unpluginName;
  }
  const plugin = (_a = this._compiler) == null ? void 0 : _a.$unpluginContext[unpluginName];

@grushetsky
Copy link

I have encountered the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants