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

TypeError: require(...) is not a function #13

Open
krajasekhar opened this issue May 31, 2018 · 7 comments
Open

TypeError: require(...) is not a function #13

krajasekhar opened this issue May 31, 2018 · 7 comments

Comments

@krajasekhar
Copy link

Getting these errors in the console after running

No Config File in Application. Framework default config will be used.
node_modules/oe-cloud/server/config.development.json

var jsFeel = require('js-feel')();
^

TypeError: require(...) is not a function
at Object. (...\oe-cloud-master\common\models\framework\decisi
on-graph.js:9:32)

TypeError: require(...) is not a function
at Object. (...\oe-cloud-master\common\models\framework\decision-serv
ice.js:9:30)

TypeError: require(...) is not a function
at Object. (...\oe-cloud-master\common\models\framework\decision-tabl
e.js:9:32)

var { createDecisionGraphAST, executeDecisionService } = jsFeel.decisionService;
^
TypeError: Cannot destructure property createDecisionGraphAST of 'undefined' or 'null'.
at Object. (..\oe-cloud-master\common\models\framework\decisi
on-graph.js:15:65)

Unhandled rejection Error: Callback was already called.
at ...\oe-cloud\node_modules\async\dist\async.js:966:32

@deostroll
Copy link
Contributor

Hi @krajasekhar

Can you confirm the version of oe-cloud you are using from package.json of your application.

@raghav135
Copy link
Member

Also what is version of node.js?

@krajasekhar
Copy link
Author

oecloud version: 1.4.2
node js version: 8.9.3

@deostroll
Copy link
Contributor

1.4.2 ❓ 😕

I am assuming you were referring to js-feel version. You may need to open the package.json file in the js-feel folder (inside node_modules). Paste the contents of the file here so we may get a better idea what actually downloaded.

@krajasekhar
Copy link
Author

I thought you are asking for this oecloud repository version. Mentioning correctly now. please check.
Root folder of the repository : {"name": "oe-cloud", "version": "1.4.2"}
js-feel in node_modules : {"name": "js-feel","version": "1.1.0"}
oe-cloud in node_modules : {"name": "oe-cloud","version": "0.9.3"}

I believe the problem is because of installation of some of the modules to its latest version other than what given in package.json. I didn't have git installed in server (manually uploaded the repo) and 'npm install' failed. so I manually installed each module with 'npm install ' and got the above errors.

@deostroll
Copy link
Contributor

Our latest release of oe-cloud at the moment is v1.4.0. It is important your front-end application that is depending on oe-cloud point to this version. I recommend you to take a backup of your current node_modules. Update your app's package.json to point to this version of oe-cloud. And do an npm install (i.e. a fresh npm install).

According to what you reported, the js-feel version is old, and, you are probably using some recent version of oe-cloud (>1.2.0). Hence the error.

@deostroll
Copy link
Contributor

@krajasekhar my apologies. The package.json shows that we are in 1.4.2, I wasn't aware of this at the time.

As long as your copy of oe-cloud (inside your app) is downloaded off this commit, 97b3ae5, you should not face an issue. But if your copy reflects this commit, 2bfbba5, then this issue would surface again. The latter is what comes with the latest release (v1.4.0), and this is a known issue.

I had the impression that the latter commit had those changes already somehow. But apparently that is not the case. Sorry, it is my mistake.

If you see this issue again you can revert back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants