vasturiano/three-globe

Webpack error with your latest version 2.25.5

vtgn opened this issue · 4 comments

vtgn commented

Describe the bug
Hello,
I'm using the dependency "globe.gl" in my VueJs project, and it has your "three-globe" project on version ^2.25 as dependency.
But since the release of your last version 15h ago, webpack's build stops in error on your code with the following message:

ERROR  Failed to compile with 1 error

 error  in ./node_modules/three-globe/dist/three-globe.mjs

Module not found: Error: Default condition should be last one

To Reproduce
Steps to reproduce the behavior:

  1. Import three-globe@2.25.5 as dependency on a vueJs module using webpack
  2. launch the command: vue-cli-service build
  3. the build stops in error

Expected behavior
It should build correctly like it does with the version 2.25.4.

Screenshots
Three-globe-error

Desktop (please complete the following information):

  • OS: Win 10, Win11

Additional context
Versions in package.json:

"@vue/cli-service": "5.0.8"
"vue": "2.6.14"
"globe.gl": "2.27.1"

Contents of our vue.config.js file:

const { defineConfig } = require("@vue/cli-service");
const webpack = require("webpack");

/**
 * Tell webpack to ignore specific dependencies that aren't used in the portal and cause build errors
 *
 * @link https://github.com/nestjs/mapped-types/issues/486
 * @link https://github.com/nestjs/nest/issues/1706
 */
const lazyImports = [
    "cache-manager",
    "class-transformer/storage",
];

module.exports = defineConfig({
	configureWebpack: {
		resolve: {
			// Ignore dependencies of Node.js APIs that aren't needed
			fallback: {
				stream: false,
				util: false
			}
		},
		plugins: [
			new webpack.IgnorePlugin({
				checkResource(resource) {
					if (lazyImports.includes(resource)) {
						try {
							require.resolve(resource);
						} catch (err) {
							return true;
						}
					}
					return false;
				},
		}),
		]
	},
	transpileDependencies: true,
vtgn commented

Workaround: override in our package.json the downloaded version of the "three-globe" dependency, to use the previous one, but it must be a temporary solution of course:
"three-globe": "2.25.4"

@vgtn this should now be fixed. Please upgrade the version of three-globe in your dependency tree to the latest. Sorry for the disturbance.

vtgn commented

@vasturiano I confirm the problem has been fixed. It works well again with the version 2.25.7.
Thank you.
Regards!

vtgn commented

Fixed.