Skip to content
New issue

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

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

Already on GitHub? # to your account

src is undefined #211

Open
1 task done
missma19 opened this issue Jun 25, 2024 · 2 comments
Open
1 task done

src is undefined #211

missma19 opened this issue Jun 25, 2024 · 2 comments
Assignees

Comments

@missma19
Copy link

Issue Type

  • Bug Fix

Current/Missing Behaviour

I'm getting the error: "Fatal error: Expected src to be a string or an array of strings. Got undefined instead.", when running nwjs:src.

Expected/Proposed Behaviour

src is set to the string, which is set in the code.

nwjs: {
	options: {
			xxx
	},
	src: "./build/src_<%= packageconfig.language %>/**/*",
	},

Additional Info

I get the same error from version 4.6.1 to 4.7.7.
Version 4.6.0 gives a totally different error.

The grunt-file works in version 3.7.1 without problems.

  • Operating System: docker build linux/amd64
  • Node version: 22
  • NW.js version: 0.88.0
@ayushmanchhabra
Copy link
Contributor

ayushmanchhabra commented Jul 14, 2024

@missma19 What version of grunt-nw-builder did you upgrade from? If you have glob enabled, then wrap the src string in an array:

src: [ "./path/to/package.json", "./build/src_<%= packageconfig.language %>/**/*" ]

Also copy of the stack trace would help.

@missma19
Copy link
Author

Hi,
I upgraded from 3.6.0.
Glob is not enabled. (There is a mistake in the readme. It says twice "when glob is enabled")

I don't know exactly what you mean with stack trace, but i guess this is what you want.

#17 2.416 Running "nwjs:src" (nwjs) task
#17 2.417 Fatal error: Expected src to be a string or an array of strings. Got undefined instead.
#17 2.418 Error: Expected src to be a string or an array of strings. Got undefined instead.
#17 2.418     at Object.<anonymous> (/master/packaging/node_modules/grunt-nw-builder/tasks/nw.js:15:15)
#17 2.418     at Object.<anonymous> (/master/packaging/node_modules/grunt/lib/grunt/task.js:252:15)
#17 2.418     at thisTask.fn (/master/packaging/node_modules/grunt/lib/grunt/task.js:70:16)
#17 2.418     at Object.<anonymous> (/master/packaging/node_modules/grunt/lib/util/task.js:294:30)
#17 2.418     at Task.runTaskFn (/master/packaging/node_modules/grunt/lib/util/task.js:244:24)
#17 2.418     at Task.<anonymous> (/master/packaging/node_modules/grunt/lib/util/task.js:293:12)
#17 2.418     at /master/packaging/node_modules/grunt/lib/util/task.js:220:11
#17 2.418     at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
#17 ERROR: process "/bin/sh -c grunt package:releases --lang=de --os=osx64" did not complete successfully: exit code: 3
------

@ayushmanchhabra ayushmanchhabra self-assigned this Aug 7, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants