GithubHelp home page GithubHelp logo

Comments (4)

planetarydev avatar planetarydev commented on May 30, 2024

Im not familiar with aws lambda, but it seems that SQLBuilder got problems loading the operator- and helper-modules located in /sql.
Some Background: SQLBuilder dynamically walks recursive through the /sql directory and loads all js-files located there. Each file represents an operator or helper like "select.js" or "from.js", etc.

Could you spend some time to analyse this. Maybe this would be some similar error with lamda https://stackoverflow.com/questions/49020710/lambda-enoent-no-such-file-or-directory

Hope this would help

Some more question: Does it work locally?

from json-sql-builder2.

dhaneshhs avatar dhaneshhs commented on May 30, 2024

@planetarydev yes it worked locally in windows system. we are using webpack it is creating the single index.js file. but these files inside /sql are not getting added to the deployment package.
sql
src
src/index.js
i made my deployment package look like this then also it is not able to find the folder
image

from json-sql-builder2.

dhaneshhs avatar dhaneshhs commented on May 30, 2024

Below warning will be displayed when Bundling with webpack.

WARNING in ./node_modules/json-sql-builder2/lib/operator.js
103:19-38 Critical dependency: the request of a dependency is an expression
@ ./node_modules/json-sql-builder2/lib/operator.js
@ ./node_modules/json-sql-builder2/lib/builder.js
@ ./node_modules/json-sql-builder2/index.js
@ ./src/index.ts

WARNING in ./node_modules/json-sql-builder2/lib/builder.js
474:18-31 Critical dependency: the request of a dependency is an expression
@ ./node_modules/json-sql-builder2/lib/builder.js
@ ./node_modules/json-sql-builder2/index.js
@ ./src/index.ts

WARNING in ./node_modules/json-sql-builder2/lib/builder.js
551:19-42 Critical dependency: the request of a dependency is an expression
@ ./node_modules/json-sql-builder2/lib/builder.js
@ ./node_modules/json-sql-builder2/index.js
@ ./src/index.ts

WARNING in ./node_modules/json-sql-builder2/lib/builder.js
568:17-40 Critical dependency: the request of a dependency is an expression
@ ./node_modules/json-sql-builder2/lib/builder.js
@ ./node_modules/json-sql-builder2/index.js
@ ./src/index.ts

from json-sql-builder2.

planetarydev avatar planetarydev commented on May 30, 2024

I think that it would not work with webpack because the require of all node-modules for operators and helpers will work dynamically by walking through the directories.

        /****
	 * Register all Modules located in the /sql directory.
	 *
	 * All Files located in a directory named "helpers" will
	 * registered as Helper. All files located in "operators" will
	 * resgistered as Operator. Directories which named "private" will be skipped.
	 *
	 */
	_loadModules(){
		let modules = tools.walk(path.join(__dirname, `../sql/`));

		_.forEach(modules, (module) => {
			if (module.endsWith('.js') && module.indexOf('private') == -1 && !path.basename(module).startsWith('.')) {
				this._register(module);
			}
		});
	}

	/**
	 * @summary Creates a new Operator or Helper
	 *
	 * @param file 	{String}	Specifies the path and filename of the operator or helper to register
	 */
	_register(file) {
		let sqlModule = require(file);
``

from json-sql-builder2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.