-
-
Notifications
You must be signed in to change notification settings - Fork 570
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
npx @million/lint@latest gatsby.js option doesn't work with gatsby-node.ts #980
Comments
Thanks for opening this issue! A maintainer will review it soon. |
Also seeing warning on yarn install: "@million/lint > [email protected]" has incorrect peer dependency "react@^16.13.1" |
possible solution is to add a type guard |
I'm having this same issue, thanks for working on it! I have mostly the same setup, except I set mine up according to the automatic instructions here: https://million.dev/docs/install. I'm using gatsby version 4.24 & react version 18.2. |
I had the same install process, but had generated js file as output. I'm using ts version, so I've just copied settings from js to ts, but got issues on dev build. |
Thanks for this @JustFly1984, but, @NisargIO can help you here. |
Actually the gatsby develop runs without the navigator error now, but when I try and access the local dev site it serves up, I get an "unhandled runtime error, cannot read properties of null (reading 'innerHTML') from line 6565 in the million/dist/packages/react-sever.mjs file. When I try to run gatsby build I get this error: WebpackError: RangeError: Maximum call stack size exceeded |
Thank you @JustFly1984 and @lmsutter, I have helped reported this to core team. Someone will respond to you soon. |
Never mind, I was confused but it got resolved. |
Wait, I'm curious; could you share what you did please? Thanks. |
@lmsutter I think that's a completely different issue with million itself and not million lint. Let me know, if yes, create another issue please. Thank you so much. |
I fixed this issue and it'll be included in the latest release soon. |
yes, sorry, thank you! |
Sounds like this is resolved. I was confused and I didn't want to add to the confusion, if it helps to hear my process though. Million/lint is not working for me currently but I'm looking forward to trying the new release. So I am using the typescript version of gatsby-node.ts like the original poster. When I ran pnpx install @million/lint@latest (pnpm is my package manager) the install went fine and it added a gatsby-node.js file with what looks like the correct setup. I am able to run my gatsby app fine (gatsby develop) but I don't see anything besides the basic text in the million/lint plugin section of vs code. When I try to add in the webpack config to my gatsby-node.ts file like this: export const onCreateWebpackConfig: GatsbyNode['onCreateWebpackConfig'] = (
args,
) => {
args.actions.setWebpackConfig({
plugins: [MillionCompiler.webpack()],
});
createPathAliases(args);
disableSourceMaps(args);
}; and run gatsby develop I get this error: ERROR #11321 PLUGIN "gatsby-node.js" threw an error while running the onCreateNode lifecycle: Cannot access 'i' before initialization 25 | };
File: gatsby-node.ts:27:14 My onCreateNode export is right after the onCreateWebpack config export so I'm guessing that's maybe why the error is showing up for that line? Deleting the gatsby-node.js file didn't help. Hope that helps, sorry! Sounds like this has been resolved. Thanks for reaching out. |
update: updated to 0.0.66, still getting navigator error |
My fix has not been included yet. |
@lmsutter Could you please create another issue for this? So I investigate it. |
I'm running into the same issue. |
Thank you for reporting this @JustFly1984, I have communicated this issue with the team. Thank you! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. |
not stale |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. |
Not stale |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. |
Not stale |
What version of
million
are you using?@million/lint@latest
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
yarn
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug
Running npx @million/lint@latest in gatsby project. I have my Gatsby config files as ts.
After choosing the framework as Gatsby, instead of editing existing gatsby-node.ts file. it just created fresh gatsby-node.js with onCreateWebpackConfig hook.
PS: I already have million/compiler setup in gatsby-node.ts. In this case, should I use both?
Thank you for your great work and project!
What's the expected result?
It should edit existing ts file and editing existing onCreateWebpackConfig function, instead of creating js file.
Link to Minimal Reproducible Example
sorry
Participation
Update: getting an error while running gatsby dev:
commenting out webpack() fixes an issue.
The text was updated successfully, but these errors were encountered: