Webpack 5: Preview build fails, window/global
See original GitHub issueTrying to upgrade the storybook to the latest version with webpack 5.
Upgrading from storybook@6.2.0-beta.14 and webpack@5.25.1. In this case, all works fine with no issues.
But with storybook@6.2.0 and webpack@5.28.0 I have some issues that were workaround by pinning webpack and other dependencies with resolutions, and removing DefinePlugin and Dotenv from final preview and manager configs.
But one issue still occurs, and I can’t figure out what causes it.
ERR! => Failed to build the preview
ERR! export 'window' (imported as 'window') was not found in 'global' (possible exports: createGlobal, createReset)
ERR! export 'window' (imported as 'window') was not found in 'global' (possible exports: createGlobal, createReset)
ERR! export 'window' (imported as 'window') was not found in 'global' (possible exports: createGlobal, createReset)
WARN {
WARN moduleIdentifier: '/.../.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/utils.js',
WARN moduleName: './.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/utils.js',
WARN loc: '75:7-13',
WARN message: "export 'window' (imported as 'window') was not found in 'global' (possible exports: createGlobal, createReset)",
WARN moduleId: 5317,
WARN moduleTrace: [
WARN {
WARN originIdentifier: '/.../.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/index.js',
WARN originName: './.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/index.js',
WARN moduleIdentifier: '/.../.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/utils.js',
WARN moduleName: './.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/utils.js',
WARN dependencies: [Array],
WARN originId: 5519,
WARN moduleId: 5317
WARN },
WARN {
WARN originIdentifier: '/.../.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/Tool.js',
WARN originName: './.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/Tool.js',
WARN moduleIdentifier: '/.../.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/index.js',
WARN moduleName: './.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/index.js',
WARN dependencies: [Array],
WARN originId: null,
WARN moduleId: 5519
WARN },
WARN {
WARN originIdentifier: '/.../.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/register.js',
WARN originName: './.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/register.js',
WARN moduleIdentifier: '/.../.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/Tool.js',
WARN moduleName: './.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/Tool.js',
WARN dependencies: [Array],
WARN originId: null,
WARN moduleId: null
WARN }
WARN ],
WARN details: undefined,
WARN stack: ' at HarmonyImportSpecifierDependency.getLinkingErrors (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/dependencies/HarmonyImportDependency.js:137:8)\n' +
WARN ' at HarmonyImportSpecifierDependency._getErrors (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:184:15)\n' +
WARN ' at HarmonyImportSpecifierDependency.getWarnings (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:160:15)\n' +
WARN ' at Compilation.reportDependencyErrorsAndWarnings (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2463:24)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2094:10\n' +
WARN ' at _next2 (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:25:1)\n' +
WARN ' at eval (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:52:1)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:343:11\n' +
WARN ' at /.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2830:7\n' +
WARN ' at Object.each (/.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2850:39)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:322:18\n' +
WARN ' at /.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2830:7\n' +
WARN ' at Object.each (/.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2850:39)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:46:16\n' +
WARN ' at Hook.eval [as callAsync] (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:48:1)\n' +
WARN ' at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/Hook.js:18:14)\n' +
WARN '\n' +
WARN "ModuleDependencyWarning: export 'window' (imported as 'window') was not found in 'global' (possible exports: createGlobal, createReset)\n" +
WARN ' at Compilation.reportDependencyErrorsAndWarnings (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2468:23)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2094:10\n' +
WARN ' at _next2 (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:25:1)\n' +
WARN ' at eval (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:52:1)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:343:11\n' +
WARN ' at /.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2830:7\n' +
WARN ' at Object.each (/.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2850:39)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:322:18\n' +
WARN ' at /.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2830:7\n' +
WARN ' at Object.each (/.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2850:39)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:46:16\n' +
WARN ' at Hook.eval [as callAsync] (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:48:1)\n' +
WARN ' at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/Hook.js:18:14)\n' +
WARN ' at Compilation.finish (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2087:28)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compiler.js:1073:19\n' +
WARN ' at processTicksAndRejections (internal/process/task_queues.js:75:11)'
WARN }
WARN {
WARN moduleIdentifier: '/.../.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/utils.js',
WARN moduleName: './.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/utils.js',
WARN loc: '75:18-35',
WARN message: "export 'window' (imported as 'window') was not found in 'global' (possible exports: createGlobal, createReset)",
WARN moduleId: 5317,
WARN moduleTrace: [
WARN {
WARN originIdentifier: '/.../.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/index.js',
WARN originName: './.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/index.js',
WARN moduleIdentifier: '/.../.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/utils.js',
WARN moduleName: './.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/utils.js',
WARN dependencies: [Array],
WARN originId: 5519,
WARN moduleId: 5317
WARN },
WARN {
WARN originIdentifier: '/.../.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/Tool.js',
WARN originName: './.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/Tool.js',
WARN moduleIdentifier: '/.../.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/index.js',
WARN moduleName: './.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/index.js',
WARN dependencies: [Array],
WARN originId: null,
WARN moduleId: 5519
WARN },
WARN {
WARN originIdentifier: '/.../.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/register.js',
WARN originName: './.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/register.js',
WARN moduleIdentifier: '/.../.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/Tool.js',
WARN moduleName: './.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/Tool.js',
WARN dependencies: [Array],
WARN originId: null,
WARN moduleId: null
WARN }
WARN ],
WARN details: undefined,
WARN stack: ' at HarmonyImportSpecifierDependency.getLinkingErrors (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/dependencies/HarmonyImportDependency.js:137:8)\n' +
WARN ' at HarmonyImportSpecifierDependency._getErrors (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:184:15)\n' +
WARN ' at HarmonyImportSpecifierDependency.getWarnings (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:160:15)\n' +
WARN ' at Compilation.reportDependencyErrorsAndWarnings (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2463:24)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2094:10\n' +
WARN ' at _next2 (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:25:1)\n' +
WARN ' at eval (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:52:1)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:343:11\n' +
WARN ' at /.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2830:7\n' +
WARN ' at Object.each (/.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2850:39)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:322:18\n' +
WARN ' at /.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2830:7\n' +
WARN ' at Object.each (/.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2850:39)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:46:16\n' +
WARN ' at Hook.eval [as callAsync] (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:48:1)\n' +
WARN ' at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/Hook.js:18:14)\n' +
WARN '\n' +
WARN "ModuleDependencyWarning: export 'window' (imported as 'window') was not found in 'global' (possible exports: createGlobal, createReset)\n" +
WARN ' at Compilation.reportDependencyErrorsAndWarnings (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2468:23)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2094:10\n' +
WARN ' at _next2 (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:25:1)\n' +
WARN ' at eval (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:52:1)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:343:11\n' +
WARN ' at /.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2830:7\n' +
WARN ' at Object.each (/.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2850:39)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:322:18\n' +
WARN ' at /.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2830:7\n' +
WARN ' at Object.each (/.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2850:39)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:46:16\n' +
WARN ' at Hook.eval [as callAsync] (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:48:1)\n' +
WARN ' at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/Hook.js:18:14)\n' +
WARN ' at Compilation.finish (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2087:28)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compiler.js:1073:19\n' +
WARN ' at processTicksAndRejections (internal/process/task_queues.js:75:11)'
WARN }
WARN {
WARN moduleIdentifier: '/.../.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/utils.js',
WARN moduleName: './.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/utils.js',
WARN loc: '76:29-46',
WARN message: "export 'window' (imported as 'window') was not found in 'global' (possible exports: createGlobal, createReset)",
WARN moduleId: 5317,
WARN moduleTrace: [
WARN {
WARN originIdentifier: '/.../.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/index.js',
WARN originName: './.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/index.js',
WARN moduleIdentifier: '/.../.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/utils.js',
WARN moduleName: './.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/utils.js',
WARN dependencies: [Array],
WARN originId: 5519,
WARN moduleId: 5317
WARN },
WARN {
WARN originIdentifier: '/.../.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/Tool.js',
WARN originName: './.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/Tool.js',
WARN moduleIdentifier: '/.../.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/index.js',
WARN moduleName: './.yarn/$$virtual/@storybook-theming-virtual-cf22236d2e/0/cache/@storybook-theming-npm-6.2.0-19b73e8025-7366254077.zip/node_modules/@storybook/theming/dist/esm/index.js',
WARN dependencies: [Array],
WARN originId: null,
WARN moduleId: 5519
WARN },
WARN {
WARN originIdentifier: '/.../.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/register.js',
WARN originName: './.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/register.js',
WARN moduleIdentifier: '/.../.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/Tool.js',
WARN moduleName: './.yarn/$$virtual/@storybook-addon-viewport-virtual-208331b40c/0/cache/@storybook-addon-viewport-npm-6.2.0-0b5ab8de75-1e51a9ab33.zip/node_modules/@storybook/addon-viewport/dist/esm/Tool.js',
WARN dependencies: [Array],
WARN originId: null,
WARN moduleId: null
WARN }
WARN ],
WARN details: undefined,
WARN stack: ' at HarmonyImportSpecifierDependency.getLinkingErrors (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/dependencies/HarmonyImportDependency.js:137:8)\n' +
WARN ' at HarmonyImportSpecifierDependency._getErrors (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:184:15)\n' +
WARN ' at HarmonyImportSpecifierDependency.getWarnings (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:160:15)\n' +
WARN ' at Compilation.reportDependencyErrorsAndWarnings (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2463:24)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2094:10\n' +
WARN ' at _next2 (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:25:1)\n' +
WARN ' at eval (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:52:1)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:343:11\n' +
WARN ' at /.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2830:7\n' +
WARN ' at Object.each (/.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2850:39)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:322:18\n' +
WARN ' at /.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2830:7\n' +
WARN ' at Object.each (/.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2850:39)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:46:16\n' +
WARN ' at Hook.eval [as callAsync] (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:48:1)\n' +
WARN ' at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/Hook.js:18:14)\n' +
WARN '\n' +
WARN "ModuleDependencyWarning: export 'window' (imported as 'window') was not found in 'global' (possible exports: createGlobal, createReset)\n" +
WARN ' at Compilation.reportDependencyErrorsAndWarnings (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2468:23)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2094:10\n' +
WARN ' at _next2 (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:25:1)\n' +
WARN ' at eval (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:52:1)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:343:11\n' +
WARN ' at /.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2830:7\n' +
WARN ' at Object.each (/.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2850:39)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:322:18\n' +
WARN ' at /.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2830:7\n' +
WARN ' at Object.each (/.../.yarn/cache/neo-async-npm-2.6.2-75d6902586-34a8f53091.zip/node_modules/neo-async/async.js:2850:39)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:46:16\n' +
WARN ' at Hook.eval [as callAsync] (eval at create (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:48:1)\n' +
WARN ' at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/.../.yarn/cache/tapable-npm-2.2.0-516ee6aa5b-f8ed725aed.zip/node_modules/tapable/lib/Hook.js:18:14)\n' +
WARN ' at Compilation.finish (/.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compilation.js:2087:28)\n' +
WARN ' at /.../.yarn/$$virtual/webpack-virtual-e76a084212/0/cache/webpack-npm-5.28.0-69f7066b52-bb1948e6a2.zip/node_modules/webpack/lib/Compiler.js:1073:19\n' +
WARN ' at processTicksAndRejections (internal/process/task_queues.js:75:11)'
WARN }
┆Issue is synchronized with this Asana task by Unito
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Webpack 5: Preview build fails, window/global #14407
But one issue still occurs, and I can't figure out what causes it. ERR! => Failed to build the preview ERR! export 'window'...
Read more >Webpack 5 build fails with Ganache module - Stack Overflow
After running build command npm run build i get following errors: > test@1.0.0 build > NODE_ENV=production webpack assets by status 65.4 MiB ...
Read more >Angular dynamic modules at runtime with Module Federation
By assigning strictVersion to true , the build will quick fail if an issue occurs. Removing this option will potentially pass the build,...
Read more >@storybook/builder-webpack5 | Yarn - Package Manager
Builder implemented with webpack5 and webpack5 -compatible loaders/plugins/config, used by @storybook/core-server to build the preview iframe.
Read more >Resolve | webpack
{ xyz: '/abc/path/to/file.js' }, /abc/path/to/file.js, error ... null-loader is deprecated in webpack 5. use alias: { xyz$: false } or absolute path alias: ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Seems like this issue isn’t happening in the latest 6.3 RC. Thanks!
Some news. The issue is happening only when using yarn berry. It’s good with npm.