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

Issue when using yarn #100

Open
titieo opened this issue Oct 23, 2020 · 10 comments
Open

Issue when using yarn #100

titieo opened this issue Oct 23, 2020 · 10 comments

Comments

@titieo
Copy link

titieo commented Oct 23, 2020

Hi there. This is my repo. Can you help me with this? I don't know why it keep reporting this issue and make the build failed (although when I run yarn build on my computer, there isn't any problem) and this happen randomly (sometimes the build failed and sometimes it success, you can check that via build history). Thanks

failed Building production JavaScript and CSS bundles - 23.236s
error Generating JavaScript bundles failed
Can't resolve 'gatsby-plugin-mdx/loaders/mdx-components' in '/home/travis/build/LocTran016/loctran016.github.io'
If you're trying to use a package make sure that 'gatsby-plugin-mdx/loaders/mdx-components' is installed. If you're trying to use a local file make sure that the path is correct.
error Generating JavaScript bundles failed
Can't resolve 'gatsby-plugin-mdx/loaders/mdx-scopes' in '/home/travis/build/LocTran016/loctran016.github.io'
If you're trying to use a package make sure that 'gatsby-plugin-mdx/loaders/mdx-scopes' is installed. If you're trying to use a local file make sure that the path is correct.
not finished Generating image thumbnails - 25.158s
error Command failed with exit code 1.

image

@titieo
Copy link
Author

titieo commented Oct 23, 2020

May be you could have a look at this article: https://spectrum.chat/mdx/general/resolved-problems-updating-to-mdx-v2-w-yarn-workspaces~126eddd4-942f-4e8b-9064-de45e8b4a4d9 and I'm currently using yarn

@shadcn
Copy link
Contributor

shadcn commented Oct 24, 2020

@LocTran016 did you figure this out? Looks like the site is running? https://loctran016.github.io

@titieo
Copy link
Author

titieo commented Oct 24, 2020

No I have not fixed this yet (don't know how to use yarn resolution). The page is working because the build used to
be success (so there is some old content in my page which make site running) and now it failed. I can't update the page's content now (When you look at the gh-pages branch, you can see that it was updated 4 days ago.) Can you help me with this? Thanks

@titieo
Copy link
Author

titieo commented Oct 26, 2020

Would you mind helping me with this? Thanks (giving me the mdx version for me to put it in the resolutions in yarn is OK

@shadcn
Copy link
Contributor

shadcn commented Oct 27, 2020

@LocTran016 Looks like someone else had the same issue. Can you take a look at the following: https://spectrum.chat/mdx/general/resolved-problems-updating-to-mdx-v2-w-yarn-workspaces~126eddd4-942f-4e8b-9064-de45e8b4a4d9?

@titieo
Copy link
Author

titieo commented Oct 27, 2020

Oh yeah, I have already read that post, tried to add to the package.json like this:

{
  "name": "fpr",
  "version": "0.8.1",
  "license": "MIT",
  "scripts": {
    "build": "gatsby build",
    "start": "gatsby develop --open",
    "serve": "gatsby serve",
    "clean": "gatsby clean",
    "dev": "gatsby clean && gatsby develop --open",
    "preview": "gatsby clean && gatsby build && gatsby serve",
    "up": "yarn upgrade --latest"
  },
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^1.2.32",
    "@fortawesome/free-brands-svg-icons": "^5.15.1",
    "@fortawesome/free-regular-svg-icons": "^5.15.1",
    "@fortawesome/free-solid-svg-icons": "^5.15.1",
    "@fortawesome/react-fontawesome": "^0.1.11",
    "@reflexjs/gatsby-plugin-metatags": "^0.2.7",
    "@reflexjs/gatsby-theme-base": "^0.3.10",
    "@reflexjs/gatsby-theme-post": "^0.6.7",
    "@reflexjs/gatsby-theme-video": "^0.4.8",
    "disqus-react": "^1.0.10",
    "gatsby": "^2.22.11",
    "gatsby-plugin-fontawesome-css": "^1.0.0",
    "gatsby-plugin-manifest": "^2.4.35",
    "gatsby-plugin-offline": "^3.2.33",
    "gatsby-plugin-sitemap": "^2.4.17",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "typeface-inter": "^1.1.13",
    "typeface-open-sans": "^1.1.13",
    "typeface-prata": "^1.1.13"
  },
  "devDependencies": {
    "run-script-os": "^1.1.1"
  },
  "resolutions": {
    "gatsby-plugin-mdx":"^1.2.15"
  }
}

but didn't help. I don't know if I had put a wrong version in mdx (I mean the version of mdx installed in the theme)

@shadcn
Copy link
Contributor

shadcn commented Oct 27, 2020

What happens if you remove gatsby-plugin-mdx from your package.json? Reflex will already pull this in as a dependency.

@titieo
Copy link
Author

titieo commented Oct 27, 2020

I used to do that, the build failed so I follow the guide above, the problem look similar and the writer told that to fix this you can use yarn resolutions

@titieo
Copy link
Author

titieo commented Oct 27, 2020

@titieo titieo changed the title Issue when building with Travis CI Issue when using yarn Nov 7, 2020
@titieo
Copy link
Author

titieo commented Nov 7, 2020

And btw, this also happen locally (on my computer), when I run yarn dev (gatsby clean && gatsby develop --open), this is what shown in the terminal:

image

P/S: When I use yarn (locally/on Travis), it usually report errors and failed (sometimes the build is success with yarn) but when I use npm (on GitHub Action), there isn't any issue (always work). Can you help me with this?

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

2 participants