Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running into dependency issue on Linux #5880

Closed
5tigerjelly opened this issue May 30, 2023 · 14 comments · Fixed by #5934
Closed

Running into dependency issue on Linux #5880

5tigerjelly opened this issue May 30, 2023 · 14 comments · Fixed by #5934
Labels
Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements.

Comments

@5tigerjelly
Copy link
Contributor

To Reproduce

I started a linux instance and installed all dependencies. I am able to run ./refine after cleaning and building. However I am running into some issues where it cannot locate the select2, jQuery when running the server on the browser. It looks like some dependency installation issue, but not sure how to fix

Current Results

GET http://127.0.0.1:3333/3rdparty/select2/select2.css net::ERR_ABORTED 404 (Not Found)
:3333/:44 

 GET http://127.0.0.1:3333/3rdparty/tablesorter/theme.blue.css net::ERR_ABORTED 404 (Not Found)

index-bundle.js:18 Uncaught ReferenceError: jQuery is not defined
    at index-bundle.js:18:12
    at index-bundle.js:20:4

VM12:1 Uncaught TypeError: Cannot set properties of undefined (setting 'encodings')
    at VM12:1:18

Expected Behavior

Fully running open refine

Screenshots

image

Versions

  • Operating System: Linux
  • Browser Version:Chrome
  • JRE or JDK Version: openjdk 11.0.19 2023-04-18
  • OpenRefine: 4.0 branch
@5tigerjelly 5tigerjelly added Type: Bug Issues related to software defects or unexpected behavior, which require resolution. Status: Pending Review Indicates that the issue or pull request is awaiting review by project maintainers or collaborators labels May 30, 2023
@Abbe98
Copy link
Member

Abbe98 commented May 30, 2023

Do you have the same issue on the master branch?

@wetneb wetneb added the 4.0 Specific to the new data processing architecture introduced in 4.0 label May 30, 2023
@wetneb
Copy link
Sponsor Member

wetneb commented May 30, 2023

It could be worth seeing your entire build logs (output of ./refine clean and ./refine build).

@5tigerjelly
Copy link
Contributor Author

This was the output using 4.0 branch : https://gist.github.com/5tigerjelly/6a631bc192b99ce5d5312c3d6e43de31

This was the output using master branch : https://gist.github.com/5tigerjelly/d8217e24e9d8c432becc6bed2b781185

@5tigerjelly
Copy link
Contributor Author

I think this might be the issue

Using refine.ini for configuration
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!

> open-refine-webapp@ postinstall /home/tigerjelly/Documents/OpenRefine/main/webapp
> node copy-dependencies.js

/home/tigerjelly/Documents/OpenRefine/main/webapp/copy-dependencies.js:1
import fs from 'fs';
       ^^

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! open-refine-webapp@ postinstall: `node copy-dependencies.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the open-refine-webapp@ postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/tigerjelly/.npm/_logs/2023-05-30T12_32_28_435Z-debug.log
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

@5tigerjelly
Copy link
Contributor Author

https://stackoverflow.com/questions/43622337/using-import-fs-from-fs

something like
import * as fs from 'fs'; or import {fs} from 'fs';
should fix this issue.

@5tigerjelly
Copy link
Contributor Author

The two above did not work const fs = require('fs'); worked
https://gist.github.com/5tigerjelly/301be45e9ce1bbb7fd88d4494aa77889

I can make a PR if this looks okay

@wetneb
Copy link
Sponsor Member

wetneb commented May 30, 2023

We really should document the minimum Nodejs version in https://openrefine.org/docs/technical-reference/contributing.

Here are my versions (for which building OpenRefine works):

$ npm --version
8.19.3
$yarn --version
1.22.19
$ node --version
v16.19.1

@thadguidry
Copy link
Member

thadguidry commented May 30, 2023

That syntax is from CommonJS and how you import a module. Differences between CommonJS and ES Modules. For details read up at https://flaviocopes.com/commonjs/
(BTW, I helped improve the Docusaurus docs themselves to mention a bit of this and other things, which was very confusing before and didn't point to a good resource such as flaviocopes.)

@5tigerjelly
Copy link
Contributor Author

I am still confused by the two responses. Is const fs = require('fs'); the desired update or no?

@wetneb
Copy link
Sponsor Member

wetneb commented May 31, 2023

If that makes it possible to lower the minimum Nodejs version I think it's worth it! It would be useful to know which version you are running.

@5tigerjelly
Copy link
Contributor Author

Here are the versions

npm --version
6.14.4
$yarn --version
not installed
$ node --version
v10.19.0

I will make the PR

@wetneb
Copy link
Sponsor Member

wetneb commented Jun 12, 2023

@5tigerjelly do you still plan on making a PR for this?

@5tigerjelly
Copy link
Contributor Author

created pull/5916

@wetneb wetneb added Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements. and removed Type: Bug Issues related to software defects or unexpected behavior, which require resolution. Status: Pending Review Indicates that the issue or pull request is awaiting review by project maintainers or collaborators 4.0 Specific to the new data processing architecture introduced in 4.0 labels Jun 13, 2023
@elebitzero
Copy link
Member

Node 14 and below are end-of-life, and Node 16 reaches end-of-life October 2023.
(Ref: https://nodejs.dev/en/about/releases/)

So, we should no longer support Node 10, 12, and 14 for development of OpenRefine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements.
Projects
None yet
5 participants