{"id":789,"hash":"8e2ae496d0c7d8707a4dd0137e8579c32d026f6300aa7e568bc6972f863e7305","pattern":"How can I find rollup 3.1.0 update error?","full_message":"i want to install rollup-plugin-visualizer but its need to update rollup.\n\nupdated rollup from 1.8.0 to 3.1.0\n\ngot error\n\n[!] RollupError: Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to \".mjs\", set \"type\": \"module\" in your package.json file or pass the \"--bundleConfigAsCjs\" flag.\n\ndelete node-modules folder and package-lock.json and install again npm i\n\ngot error\n\nnpm ERR! code ERESOLVE\nnpm ERR! ERESOLVE unable to resolve dependency tree\nnpm ERR! \nnpm ERR! While resolving: @bet-core/ui@2.4.0\nnpm ERR! Found: rollup@3.1.0\nnpm ERR! node_modules/rollup\nnpm ERR!   dev rollup@\"^3.1.0\" from the root project\nnpm ERR! \nnpm ERR! Could not resolve dependency:\nnpm ERR! peer rollup@\">=0.60.0 <3\" from rollup-plugin-babel@4.4.0\nnpm ERR! node_modules/rollup-plugin-babel\nnpm ERR!   dev rollup-plugin-babel@\"^4.3.2\" from the root project\n\nrollup-plugin-babel npm page says !!!\n\n💡 This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.\n\ni have delete rollup-plugin-babel then install @rollup/plugin-babel.\nnow i got this error\n\n[!] RollupError: Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to \".mjs\", set \"type\": \"module\" in your package.json file or pass the \"--bundleConfigAsCjs\" flag.\n    Original error: Cannot use import statement outside a module\n\ncan someone tell me where to look for this error solutions?","ecosystem":"npm","package_name":"package","package_version":null,"solution":"i have find the solution.\nAt first changed format from 'esm' to 'cjs' in rollup.config.js\n\nexport default {\n    ...\n    output: [\n             {\n                format: 'cjs',\n                ...\n            },\n       \n    ]\n};\n\nthen rollup.config.js changed to rollup.config.mjs","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/74070901/how-can-i-find-rollup-3-1-0-update-error","votes":12,"created_at":"2026-04-19T04:51:43.003866+00:00","updated_at":"2026-04-19T04:51:43.003866+00:00"}