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

run “npm run build” failid in superset-frontend (0.37.0) #10997

Closed
michaelai0313 opened this issue Sep 22, 2020 · 9 comments · Fixed by #18685
Closed

run “npm run build” failid in superset-frontend (0.37.0) #10997

michaelai0313 opened this issue Sep 22, 2020 · 9 comments · Fixed by #18685
Labels
#bug:cant-reproduce Bugs that cannot be reproduced !deprecated-label:bug Deprecated label - Use #bug instead need:more-info Requires more information from author

Comments

@michaelai0313
Copy link

michaelai0313 commented Sep 22, 2020

run “npm run build” failid in superset-frontend

Actual results

ERROR in ./src/visualizations/TimeTable/TimeTable.jsx 101:10
Module parse failed: Unexpected token (101:10)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|       if (fullUrl) {
|         return (
>           <a href={fullUrl} rel="noopener noreferrer" target="_blank">
|             {column.label}
|           </a>

ERROR in ./src/SqlLab/App.jsx 111:2
Module parse failed: Unexpected token (111:2)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|
| const Application = () => (
>   <Provider store={store}>
|     <ThemeProvider theme={supersetTheme}>
|       <App />

ERROR in ./src/explore/controls.jsx 135:23
Module parse failed: Unexpected token (135:23)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|   includeTime: false,
|   description: t('One or many controls to group by'),
>   optionRenderer: c => <ColumnOption column={c} showType />,
|   valueRenderer: c => <ColumnOption column={c} />,
|   valueKey: 'column_name',

ERROR in ./src/explore/components/controls/VizTypeControl.jsx 146:6
Module parse failed: Unexpected token (146:6)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|
|     return (
>       <div
|         className={`viztype-selector-container ${isSelected ? 'selected' : ''}
`}
|         onClick={this.onChange.bind(this, key)}

ERROR in ./src/dashboard/components/PropertiesModal.jsx 188:6
Module parse failed: Unexpected token (188:6)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|     const { values, isDashboardLoaded, isAdvancedOpen } = this.state;
|     return (
>       <Modal show={this.props.show} onHide={this.props.onHide} bsSize="lg">
|         <form onSubmit={this.save}>
|           <Modal.Header closeButton>

ERROR in ./src/visualizations/FilterBox/FilterBox.jsx 233:26
Module parse failed: Unexpected token (233:26)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|       }),
|     });
>     const options = (json?.data?.[key] || []).filter(x => x.id);
|     if (!options || options.length === 0) {
|       return [];

ERROR in ./src/components/TableSelector.jsx 243:6
Module parse failed: Unexpected token (243:6)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|   renderDatabaseOption(db) {
|     return (
>       <span>
|         <Label bsStyle="default" className="m-r-5">
|           {db.backend}

ERROR in ./src/showSavedQuery/index.jsx 39:4
Module parse failed: Unexpected token (39:4)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|
|   ReactDom.render(
>     <div>
|       <Form
|         schema={config.JSONSCHEMA}

ERROR in ./src/explore/controlPanels/FilterBox.jsx 41:9
Module parse failed: Unexpected token (41:9)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|           },
|         ],
>         [<hr />],
|         [
|           {

ERROR in ./src/dashboard/index.jsx 42:16
Module parse failed: Unexpected token (42:16)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
| );
|
> ReactDOM.render(<App store={store} />, document.getElementById('app'));
|

ERROR in ./src/explore/controlPanels/Shared_DeckGL.jsx 42:2
Module parse failed: Unexpected token (42:2)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|   'blob/master/superset-frontend/src/modules/sandbox.js';
| const jsFunctionInfo = (
>   <div>
|     {t(
|       'For more information about objects are in context in the scope of this
function, refer to the',

ERROR in ./src/explore/index.jsx 44:16
Module parse failed: Unexpected token (44:16)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
| );
|
> ReactDOM.render(<App store={store} />, document.getElementById('app'));
|

ERROR in ./src/components/TooltipWrapper.jsx 47:4
Module parse failed: Unexpected token (47:4)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
| }) {
|   return (
>     <OverlayTrigger
|       placement={placement}
|       overlay={<Tooltip id={`${kebabCase(label)}-tooltip`}>{tooltip}</Tooltip>
}

ERROR in ./src/components/ErrorBoundary.jsx 50:8
Module parse failed: Unexpected token (50:8)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|       const firstLine = error.toString();
|       const message = (
>         <span>
|           <strong>{t('Unexpected error')}</strong>
|           {firstLine ? `: ${firstLine}` : ''}

ERROR in ./src/components/Button.jsx 54:4
Module parse failed: Unexpected token (54:4)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|
|   let button = (
>     <BootstrapButton {...buttonProps}>{props.children}</BootstrapButton>
|   );
|   if (tooltip) {

ERROR in ./src/components/TableLoader.jsx 64:13
Module parse failed: Unexpected token (64:13)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|   render() {
|     if (this.state.isLoading) {
>       return <Loading />;
|     }
|

ERROR in ./src/components/Menu/Menu.jsx 67:4
Module parse failed: Unexpected token (67:4)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
| }) {
|   return (
>     <StyledHeader className="top" id="main-menu">
|       <Navbar inverse fluid staticTop role="navigation">
|         <Navbar.Header>

ERROR in ./src/components/Select/OnPasteSelect.jsx 79:11
Module parse failed: Unexpected token (79:11)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
|   render() {
|     const { selectWrap: SelectComponent, ...restProps } = this.props;
>     return <SelectComponent {...restProps} onPaste={this.onPaste} />;
|   }
| }
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `cross-env NODE_OPTIONS=--max_old_space_size=819
2 NODE_ENV=production webpack --mode=production --colors`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.


Environment
(please complete the following information):

superset version: 0.36.0
python version: 3.6.10
node.js version: v12.18.3
npm version: 6.14.6
@michaelai0313 michaelai0313 added the !deprecated-label:bug Deprecated label - Use #bug instead label Sep 22, 2020
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.62. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@mistercrunch
Copy link
Member

npm ci help ? (it nukes /node_modules)

@michaelai0313
Copy link
Author

npm ci help ? (it nukes /node_modules)

when I used npm install,it failed all the time
I use yarn to install successfully,but build failed all the time

@luoxiao123
Copy link

i hava the same issue

@eschutho
Copy link
Member

eschutho commented Nov 7, 2020

can you share the errors that you saw when you ran npm install? It looks like you don't have babel/preset-react installed correctly.

@mistercrunch mistercrunch added #bug:cant-reproduce Bugs that cannot be reproduced need:more-info Requires more information from author labels Nov 8, 2020
@luoxiao123
Copy link

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\lx\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]prebuild: [email protected]
6 info lifecycle [email protected]
build: [email protected]
7 verbose lifecycle [email protected]build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
build: PATH: C:\Users\lx\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\lx_workspace\pythonspace\workspace5\incubator-superset-0.38.0\superset-frontend\node_modules.bin;E:\lx_workspace\xshell;C:\Windows\System32;c:\windows\system32\WindowsPowershell\v1.0;E:\lx_workspace\jdk_dir\jdk1.8.0_191\bin;E:\lx_workspace\jdk_dir\jdk1.8.0_191\jre\bin;C:\Users\lx\Android\Sdk\platform-tools;C:\Program Files\Git\cmd;C:\Program Files\nodejs;E:\lx_soft\Tesseract-OCR;E:\lx_workspace\pythonspace\sdk3.7.7;E:\lx_workspace\pythonspace\sdk3.7.7\Scripts;C:\Users\lx\AppData\Roaming\npm
9 verbose lifecycle [email protected]build: CWD: E:\lx_workspace\pythonspace\workspace5\incubator-superset-0.38.0\superset-frontend
10 silly lifecycle [email protected]
build: Args: [
10 silly lifecycle '/d /s /c',
10 silly lifecycle 'cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors'
10 silly lifecycle ]
11 silly lifecycle [email protected]build: Returned: code: 2 signal: null
12 info lifecycle [email protected]
build: Failed to exec build script
13 verbose stack Error: [email protected] build: cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors
13 verbose stack Exit status 2
13 verbose stack at EventEmitter. (C:\Users\lx\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:310:20)
13 verbose stack at ChildProcess. (C:\Users\lx\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:310:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd E:\lx_workspace\pythonspace\workspace5\incubator-superset-0.38.0\superset-frontend
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\lx\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "build"
18 verbose node v12.16.2
19 verbose npm v6.14.8
20 error code ELIFECYCLE
21 error errno 2
22 error [email protected] build: cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors
22 error Exit status 2
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

image

@lybtt
Copy link

lybtt commented Feb 1, 2021

I hava the same issue in windows, adding this might help.

image

@sonikanishk
Copy link

adding path.resolve(__dirname,'./src') below line 338 in webpack.config.js solved it thanks !!! @lybtt

@ktmud
Copy link
Member

ktmud commented Feb 13, 2021

This seems to be windows specific. It uses \ in file paths instead of /, breaking the regular expressions in Webpack's loader match rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug:cant-reproduce Bugs that cannot be reproduced !deprecated-label:bug Deprecated label - Use #bug instead need:more-info Requires more information from author
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants