xeokit-sdk icon indicating copy to clipboard operation
xeokit-sdk copied to clipboard

Why do I get an error when running rollup --config rollup.config.js ?

Open mysterieux30 opened this issue 2 years ago • 1 comments

Why do I get this error when I run rollup --config rollup.config.js in the xeokit-sdk folder after installing all node modules?

rollup --config rollup.config.js

./src/index.js → ./dist/xeokit-sdk.es.js, ./dist/xeokit-sdk.cjs.js, ./dist/xeokit-sdk.es5.js...
Dynamic import can only be supported when transforming ES modules to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled.
[BABEL] Note: The code generator has deoptimised the styling of undefined as it exceeds the max of 500KB.
(!) Missing exports
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
node_modules\@loaders.gl\worker-utils\dist\esm\lib\library-utils\library-utils.js
requireFromFile is not exported by node-resolve:empty.js
49:   if (!isBrowser) {
50:     try {
51:       return node && node.requireFromFile && (await node.requireFromFile(libraryUrl));
                              ^
52:     } catch {
53:       return null;
node_modules\@loaders.gl\worker-utils\dist\esm\lib\library-utils\library-utils.js
requireFromFile is not exported by node-resolve:empty.js
49:   if (!isBrowser) {
50:     try {
51:       return node && node.requireFromFile && (await node.requireFromFile(libraryUrl));
                                                             ^
52:     } catch {
53:       return null;
node_modules\@loaders.gl\worker-utils\dist\esm\lib\library-utils\library-utils.js
requireFromString is not exported by node-resolve:empty.js
66: function loadLibraryFromString(scriptSource, id) {
67:   if (!isBrowser) {
68:     return node.requireFromString && node.requireFromString(scriptSource, id);
                    ^
69:   }
node_modules\@loaders.gl\worker-utils\dist\esm\lib\library-utils\library-utils.js
requireFromString is not exported by node-resolve:empty.js
66: function loadLibraryFromString(scriptSource, id) {
67:   if (!isBrowser) {
68:     return node.requireFromString && node.requireFromString(scriptSource, id);
                                              ^
69:   }
node_modules\@loaders.gl\loader-utils\dist\esm\lib\binary-utils\buffer-utils.js
toBuffer is not exported by node-resolve:empty.js
4: }
5: export function toBuffer(data) {
6:   return node.toBuffer ? node.toBuffer(data) : data;
                 ^
7: }
8: export function bufferToArrayBuffer(buffer) {
node_modules\@loaders.gl\loader-utils\dist\esm\lib\binary-utils\buffer-utils.js
toBuffer is not exported by node-resolve:empty.js
4: }
5: export function toBuffer(data) {
6:   return node.toBuffer ? node.toBuffer(data) : data;
                                 ^
7: }
8: export function bufferToArrayBuffer(buffer) {
node_modules\@loaders.gl\loader-utils\dist\esm\lib\filesystems\node-filesystem.js
readdir is not exported by node-resolve:empty.js
6:
7:   async readdir(dirname = '.', options) {
8:     return await fs.readdir(dirname, options);
                       ^
9:   }
node_modules\@loaders.gl\loader-utils\dist\esm\lib\filesystems\node-filesystem.js
stat is not exported by node-resolve:empty.js
10:
11:   async stat(path, options) {
12:     const info = await fs.stat(path, options);
                              ^
13:     return {
14:       size: Number(info.size),
node_modules\@loaders.gl\loader-utils\dist\esm\lib\filesystems\node-filesystem.js
open is not exported by node-resolve:empty.js
24:
25:   async open(path, flags, mode) {
26:     return await fs.open(path, flags);
                        ^
27:   }
node_modules\@loaders.gl\loader-utils\dist\esm\lib\filesystems\node-filesystem.js
close is not exported by node-resolve:empty.js
28:
29:   async close(fd) {
30:     return await fs.close(fd);
                        ^
31:   }
node_modules\@loaders.gl\loader-utils\dist\esm\lib\filesystems\node-filesystem.js
fstat is not exported by node-resolve:empty.js
32:
33:   async fstat(fd) {
34:     const info = await fs.fstat(fd);
                              ^
35:     return info;
36:   }
node_modules\@loaders.gl\loader-utils\dist\esm\lib\filesystems\node-filesystem.js
read is not exported by node-resolve:empty.js
47:       const {
48:         bytesRead
49:       } = await fs.read(fd, buffer, offset + totalBytesRead, length - totalBytesRead, position + totalBytesRead);
                       ^
50:       totalBytesRead += bytesRead;
51:     }
node_modules\@loaders.gl\core\dist\esm\lib\fetch\read-array-buffer.js
_readToArrayBuffer is not exported by node-resolve:empty.js
2: export async function readArrayBuffer(file, start, length) {
3:   if (typeof file === 'number') {
4:     return await fs._readToArrayBuffer(file, start, length);
                       ^
5:   }
node_modules\@loaders.gl\core\dist\esm\lib\fetch\read-file.js
readFileSync is not exported by node-resolve:empty.js
5:
6:   if (!isBrowser) {
7:     const buffer = fs.readFileSync(url, options);
                         ^
8:     return typeof buffer !== 'string' ? toArrayBuffer(buffer) : buffer;
9:   }
node_modules\@loaders.gl\core\dist\esm\lib\fetch\write-file.js
writeFile is not exported by node-resolve:empty.js
5:
6:   if (!isBrowser) {
7:     await fs.writeFile(filePath, toBuffer(arrayBufferOrString), {
                ^
8:       flag: 'w'
9:     });
node_modules\@loaders.gl\core\dist\esm\lib\fetch\write-file.js
writeFileSync is not exported by node-resolve:empty.js
16:
17:   if (!isBrowser) {
18:     fs.writeFileSync(filePath, toBuffer(arrayBufferOrString), {
           ^
19:       flag: 'w'
20:     });
created ./dist/xeokit-sdk.es.js, ./dist/xeokit-sdk.cjs.js, ./dist/xeokit-sdk.es5.js in 32.1s

How can I solve this problem please? i want to be able to launch the bundling by myself...?

mysterieux30 avatar Aug 02 '22 14:08 mysterieux30

This error is from a dependency, loaders.gl, which seems to build with warnings within our process.

I'm not sure what we can fix on our end, if anything, but the warnings do not seem to affect us.

Any help with workarounds in our build process would be welcome, if anyone has a workaround.

xeolabs avatar Aug 23 '22 13:08 xeolabs