-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
v1.0.0-rc.* Compiled with errors: Module parse failed: Unexpected token #704
Comments
Having the same issue. Though it was similar to #596, but I couldn't fix it by downgrading webpack |
@mlshv Same here! |
I'll close this issue in order do #596 |
@pedronauck But #596 doesn't show the same error and the solution is not the same |
Having the same issue with rc7
Downgrading webpack using |
Having the same issue with rc7. Downgrading my webpack version to 4.28.4 does not solve it. |
@JoeCMorgan I also tried a clean project using Yarn instead of npm and that seems to work without the downgrade. |
Just wanted to chime in and say that I'm also having this issue on rc7. The workaround mentioned in #596 (#596 (comment)) is valid if you're able to use yarn, but I for one can't go that route due to how our packages are built in our CI engine. |
Unfortunately I'm still getting the issue with yarn and a clean project:
Still getting the same error. |
For me, use yarn solves the problem, but it's a temporal solution because I need to use npm. |
Yep, it would be great to make this work properly with npm. I had to install the package and its dependencies with yarn otherwise it would not work. |
Digging into this, I saw that has a problem related to the way that npm solves dependencies, you can see more details about this here: I'll try to find some solution and release in the next version. |
I'll pin
"devDependencies": {
"docz": "1.0.0-rc.7",
"docz-core": "1.0.0-rc.7",
"docz-theme-default": "1.0.0-rc.7",
},
$ npm add [email protected] --save-dev
This could work 👍 |
I'm experiencing this issue. The above fix does not resolve.
I have a single /src/index.mdx
I deleted When I run |
Did you try to downgrade webpack @dannyrb? |
Cleaning 👍 Works
👎 Fails
Solution
Thanks for your help, @pedronauck 👍 I know answering questions like this one aren't fun, but I do really, really appreciate your time <3 |
Downgrading webpack or setting
Do you have an ideas what else can be an issue? |
Still broken for me as well, reverted back to version 0.13.7 for now. |
I'm trying to migrate Docz from v0.13.7 to v1.0.0. My project is in TypeScript, so I have my doczrc.js configured like this: {
wrapper: "wrapper.tsx",
typescript: true
} and import * as React from "react";
import { AppContext } from "./src/AppContext";
import { LanguagePicker } from "./src/LanguagePicker";
let defaultLanguage = "en-us";
const Wrapper: React.FunctionComponent = (props) => {
return (
<AppContext lang={defaultLanguage}>
<div>{props.children}</div>
<div>
<LanguagePicker/>
</div>
</AppContext>
);
};
export default Wrapper; This setup used to work, but after upgrading to docz v1, I get this error:
|
This issue should not be closed. |
Also instead of installing "resolutions": {
"docz/**/webpack": "4.28.4"
} |
@sanohin Adding above resolution and clean yarn install after that works for me. Thanks |
I was facing this issue with 1.2.0. It took me an entire day, but upgrading all of my babel-related and I tried pretty much everything in this thread, related threads, and Webpack issues and none of them worked. After playing around with different combinations of package versions, I think the one that fixed it for me was upgrading webpack to 4.31.0. |
@sanohin Thanks! It solves for me. |
@sanohin Works for me, thanks. |
@sanohin finally a fix that works, thanks a lot. |
apparently this does not work when using workspaces |
@pedronauck why this is closed? I'm use CRA and installed [email protected], but after run the script there error ocurred:
|
+1 |
No need to add those comments, the maintainer is doing a great job and does not deserve comments like that. |
This method only works when doing the following:
|
Couldn't get it working by any of these methods:
What is actually worked: "acorn": "^6.1.1",
"webpack": "~4.34.0", rm -rf node_modules package-lock.json && npm i |
This would only work with yarn. For npm this might work https://www.npmjs.com/package/npm-force-resolutions To verify what you have installed and resolved, use:
Still: Does not fix it for me, started with a fresh export default {
src: 'src/components/mdx',
files: 'docs/**/*.{md,markdown,mdx}',
wrapper: 'src/docz-wrapper.js'
} src/docz-wrapper.js import React from 'react'
import { ThemeProvider } from 'styled-components'
import themeConfig from './utils/styling/theme.config'
export default ({ children }) => (
<ThemeProvider theme={themeConfig}>{children}</ThemeProvider>
) Any ideas? Now trying Update:Turned out this is not related at all to my issue, my config above is wrong. I exclude the wrapper by setting src so deep down. This works now: export default {
files: './docs/**/*.{md,markdown,mdx}',
wrapper: 'src/docz-wrapper'
} |
My case is particular. I have a monorepo:
Done! |
Bug Report
Describe the bug
When I try to run
docz dev
I get multiple errors regarding an appropriate loaderEnvironment
├─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
└── [email protected]
Additional context/Screenshots
The text was updated successfully, but these errors were encountered: