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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃摑 Documentation: Create React App instructions are broken #1007

Closed
2 tasks done
philsherry opened this issue Mar 22, 2024 · 11 comments
Closed
2 tasks done

馃摑 Documentation: Create React App instructions are broken #1007

philsherry opened this issue Mar 22, 2024 · 11 comments
Labels

Comments

@philsherry
Copy link

Bug Report Checklist

  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

Neither of your CRA installation instructions work and result in million.craco is not a function (not sure why there are two; assuming oversight). They鈥檙e different enough to make me end up here and ask if someone can clarify.

Cheers.

  1. https://million.dev/blog/lint
const MillionCompiler = require('@million/lint');
 
module.exports = {
  plugins: [MillionCompiler.craco({ legacyHmr: true })],
};
  1. https://million.dev/docs/install
const million = require("million/compiler");
 
module.exports = {
  webpack: {
    plugins: { add: [million.webpack({ auto: true })] },
  },
};

Additional Info

Yes, I have craco installed and configured.

Copy link

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

@tobySolutions
Copy link
Contributor

Hmm, hello there @philsherry, thank you for reporting this. It would really help me a lot if you provided a reproduction. Do you think you can help with that?

I don't seem to be experiencing the same issues on my end.

@cloughy
Copy link

cloughy commented Mar 25, 2024

im having the exact same issue trying to use @million/lint. having craco installed on a CRA, following those instructions i get the following error TypeError: MillionCompiler.craco is not a function on craco.js.

/Users/[...]/craco.config.js:7
    plugins: [MillionCompiler.craco({ legacyHmr: true })],

On the other hand million/compiler works as expected.

@philsherry
Copy link
Author

@tobySolutions There are two different sets of installation instructions for the same task, appearing in two different places. Is it safe to assume that there should only be one set of instructions? If so, which of the two is correct? @cloughy gets the same issue that I reported by running the code from one of those sets of instructions.

Can someone please clarify the instructions for installation with craco, and then update the blog or docs to reflect that clarity? Maybe even add a working example with a craco.config.js?

@tobySolutions
Copy link
Contributor

Um, thank you very much @philsherry, @cloughy. Craco with Million optimizer seems to be working fine for me with this same config:

const million = require("million/compiler");
 
module.exports = {
  webpack: {
    plugins: { add: [million.webpack({ auto: true })] },
  },
};

With Million Lint however, there have been cases where people experienced difficulties using Craco to set up Million lintand the team has worked to get that resolved. In the very next and upcoming release, issues like these wouldn't happen again.

Thank you @philsherry, maybe you can help with a reproduction for the cases so I can further investigate. I will begin work on the docs though to help clear out and clarify things on there.

@aviv-skillset
Copy link

I'd love to add some context,

const MillionCompiler = require('@million/lint/dist/compiler/craco');

does export something that can't be imported otherwise (without mentioning the dist folder explicitly) which looks like a craco middleware, yet it does not work even if you try to import it.

@tobySolutions
Copy link
Contributor

@tobySolutions There are two different sets of installation instructions for the same task, appearing in two different places. Is it safe to assume that there should only be one set of instructions? If so, which of the two is correct? @cloughy gets the same issue that I reported by running the code from one of those sets of instructions.

Can someone please clarify the instructions for installation with craco, and then update the blog or docs to reflect that clarity? Maybe even add a working example with a craco.config.js?

Hello there @philsherry, sorry for the confusion. Yes, they are two different installations; the first one is for the Million OSS (Million optimizer) and the other is for Million Lint (The Linter).

Copy link

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.

@github-actions github-actions bot added the Stale label Apr 20, 2024
@aviv-skillset
Copy link

I still haven't seen any progress in this issue (to be honest, didn't try to install again in case the versions bumped). just commenting to show this is not stale

@github-actions github-actions bot removed the Stale label Apr 22, 2024
@tobySolutions
Copy link
Contributor

I still haven't seen any progress in this issue (to be honest, didn't try to install again in case the versions bumped). just commenting to show this is not stale

Hey there, sorry for the auto-labelling bot. Can you please retry and let me know how that goes? I'll see to it that the team's attention is drawn to this if you still experience the same thing.

Copy link

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.

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

No branches or pull requests

4 participants