Redash: 'import/order' errors when building the front end assets

Created on 1 Jul 2019  ยท  8Comments  ยท  Source: getredash/redash

Issue Summary

When running npm run build for the first time, following the Docker Based Development Installation Guide, several errors are shown:

WARNING in ./client/app/pages/alert/index.js
Module Error (from ./node_modules/eslint-loader/index.js):

/home/jc/redash/client/app/pages/alert/index.js
  3:1  error  `antd/lib/modal` import should occur before import of `@/services/notification`  import/order

โœ– 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

 @ [\\/.]test[\\.\/]).)*\.jsx?$ (./client/app/pages sync ^((?![\\/.]test[\\.\/]).)*\.jsx?$) ./alert/index.js
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

WARNING in ./client/app/visualizations/choropleth/index.js
Module Error (from ./node_modules/eslint-loader/index.js):

/home/jc/redash/client/app/visualizations/choropleth/index.js
  7:1  error  `angular2react` import should occur before import of `@/lib/value-format`  import/order

โœ– 1 problem (1 error, 0 warnings)

 @ [\\/.]test[\\.\/]).)*\.jsx?$ (./client/app/visualizations sync ^((?![\\/.]test[\\.\/]).)*\.jsx?$) ./choropleth/index.js
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

WARNING in ./client/app/visualizations/details/DetailsRenderer.jsx
Module Error (from ./node_modules/eslint-loader/index.js):

/home/jc/redash/client/app/visualizations/details/DetailsRenderer.jsx
  4:1  error  `antd/lib/pagination` import should occur before import of `@/visualizations`  import/order

โœ– 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

 @ [\\/.]test[\\.\/]).)*\.jsx?$ (./client/app/visualizations sync ^((?![\\/.]test[\\.\/]).)*\.jsx?$) ./details/DetailsRenderer.jsx
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

WARNING in ./client/app/visualizations/sunburst/index.js
Module Error (from ./node_modules/eslint-loader/index.js):

/home/jc/redash/client/app/visualizations/sunburst/index.js
  3:1  error  `angular2react` import should occur before import of `@/lib/visualizations/sunburst`  import/order

โœ– 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

 @ [\\/.]test[\\.\/]).)*\.jsx?$ (./client/app/visualizations sync ^((?![\\/.]test[\\.\/]).)*\.jsx?$) ./sunburst/index.js
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

Are these safe to ignore, or do they indicate a problem we should fix? :smile:

All 8 comments

Seems it's time ~for a party~ to fix all eslint warnings :tada:

P.S. Will do it tomorrow, usually it's quite fast

Cool, thanks @kravets-levko. :smile:

This turned out to be caused by running an old version of Node.js (6.x).

After switching to Node.js 10.x, the front end assets built without error.

Thanks for the assist @kravets-levko. :smile:

Hitting this again, just now, but with Node.js 10:

> node --version
v10.16.0

@kravets-levko any ideas? :smile:

New error and warning output, from running npm run build on a fresh git clone:

WARNING in ./client/app/components/ParameterValueInput.jsx
Module Error (from ./node_modules/eslint-loader/index.js):

/home/jc/git_repos/redash/redash/client/app/components/ParameterValueInput.jsx
   8:1  error  `lodash` import should occur before import of `@/components/dynamic-parameters/DateParameter`  import/order
  56:7  error  Do not use setState in componentDidUpdate                                                      react/no-did-update-set-state

โœ– 2 problems (2 errors, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

 @ [\\\/.]test[\\.\/]).)*\.jsx?$ (./client/app/components sync ^((?![\\\/.]test[\\.\/]).)*\.jsx?$) ./ParameterValueInput.jsx
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

WARNING in ./client/app/components/Parameters.jsx
Module Error (from ./node_modules/eslint-loader/index.js):

/home/jc/git_repos/redash/redash/client/app/components/Parameters.jsx
  67:7  error  Do not use setState in componentDidUpdate  react/no-did-update-set-state

โœ– 1 problem (1 error, 0 warnings)

 @ [\\\/.]test[\\.\/]).)*\.jsx?$ (./client/app/components sync ^((?![\\\/.]test[\\.\/]).)*\.jsx?$) ./Parameters.jsx
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

WARNING in ./client/app/pages/alert/index.js
Module Error (from ./node_modules/eslint-loader/index.js):

/home/jc/git_repos/redash/redash/client/app/pages/alert/index.js
  3:1  error  `antd/lib/modal` import should occur before import of `@/services/notification`  import/order

โœ– 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

 @ [\\\/.]test[\\.\/]).)*\.jsx?$ (./client/app/pages sync ^((?![\\\/.]test[\\.\/]).)*\.jsx?$) ./alert/index.js
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

WARNING in ./client/app/visualizations/choropleth/index.js
Module Error (from ./node_modules/eslint-loader/index.js):

/home/jc/git_repos/redash/redash/client/app/visualizations/choropleth/index.js
  7:1  error  `angular2react` import should occur before import of `@/lib/value-format`  import/order

โœ– 1 problem (1 error, 0 warnings)

 @ [\\\/.]test[\\.\/]).)*\.jsx?$ (./client/app/visualizations sync ^((?![\\\/.]test[\\.\/]).)*\.jsx?$) ./choropleth/index.js
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

WARNING in ./client/app/visualizations/details/DetailsRenderer.jsx
Module Error (from ./node_modules/eslint-loader/index.js):

/home/jc/git_repos/redash/redash/client/app/visualizations/details/DetailsRenderer.jsx
  6:1  error  `antd/lib/pagination` import should occur before import of `@/visualizations`  import/order

โœ– 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

 @ [\\\/.]test[\\.\/]).)*\.jsx?$ (./client/app/visualizations sync ^((?![\\\/.]test[\\.\/]).)*\.jsx?$) ./details/DetailsRenderer.jsx
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

WARNING in ./client/app/visualizations/sunburst/index.js
Module Error (from ./node_modules/eslint-loader/index.js):

/home/jc/git_repos/redash/redash/client/app/visualizations/sunburst/index.js
  3:1  error  `angular2react` import should occur before import of `@/lib/visualizations/sunburst`  import/order

โœ– 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

 @ [\\\/.]test[\\.\/]).)*\.jsx?$ (./client/app/visualizations sync ^((?![\\\/.]test[\\.\/]).)*\.jsx?$) ./sunburst/index.js
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

WARNING in ./client/app/components/PreviewCard.jsx
Module Warning (from ./node_modules/eslint-loader/index.js):

/home/jc/git_repos/redash/redash/client/app/components/PreviewCard.jsx
  45:53  warning  'user.id' is missing in props validation        react/prop-types
  72:66  warning  'dataSource.id' is missing in props validation  react/prop-types

โœ– 2 problems (0 errors, 2 warnings)

 @ [\\\/.]test[\\.\/]).)*\.jsx?$ (./client/app/components sync ^((?![\\\/.]test[\\.\/]).)*\.jsx?$) ./PreviewCard.jsx
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

WARNING in ./client/app/components/groups/GroupName.jsx
Module Warning (from ./node_modules/eslint-loader/index.js):

/home/jc/git_repos/redash/redash/client/app/components/groups/GroupName.jsx
  17:49  warning  'group.type' is missing in props validation  react/prop-types

โœ– 1 problem (0 errors, 1 warning)

 @ [\\\/.]test[\\.\/]).)*\.jsx?$ (./client/app/components sync ^((?![\\\/.]test[\\.\/]).)*\.jsx?$) ./groups/GroupName.jsx
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

ERROR in ./client/app/components/TimeAgo.jsx
Module Error (from ./node_modules/eslint-loader/index.js):

/home/jc/git_repos/redash/redash/client/app/components/TimeAgo.jsx
  9:1  error  `antd/lib/tooltip` import should occur before import of `@/components/proptypes`  import/order

โœ– 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

 @ ./client/app/pages/admin/OutdatedQueries.jsx 33:0-47 155:51-58
 @ ./client/app/pages sync ^((?![\\\/.]test[\\.\/]).)*\.jsx?$
 @ ./client/app/config/index.js
 @ ./client/app/index.js
 @ multi ./client/app/index.js ./client/app/assets/less/main.less ./client/app/assets/less/ant.less

ERROR in ./client/app/config/index.js
Module Error (from ./node_modules/eslint-loader/index.js):

/home/jc/git_repos/redash/redash/client/app/config/index.js
  33:1  error  `moment` import should occur before import of `@/components/DialogWrapper`  import/order

โœ– 1 problem (1 error, 0 warnings)

@justinclift Can you please provide more info: what you do step by step, versions of node/npm or other related software.

On my Ubuntu 18.04 (NodeJS 10.13.0 / NPM 6.11.2), with just cloned repo after running only npm install:
npm run build - no errors
npm run watch - no errors
npm run lint - no errors

Interesting. Setting up a new laptop (with OpenSuSE Leap 15.x) tonight, so that'll be a good chance to see if this happens with that too. Should have further info tonight/tomorrow morning (depending on how it goes). :wink:

Got around to trying this again just now... and this time it worked. Weird. :wink:

Was this page helpful?
0 / 5 - 0 ratings