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

throw new ERR_INVALID_ARG_TYPE(name, 'string', value); #107

Closed
archoda opened this issue Apr 18, 2021 · 22 comments
Closed

throw new ERR_INVALID_ARG_TYPE(name, 'string', value); #107

archoda opened this issue Apr 18, 2021 · 22 comments

Comments

@archoda
Copy link

archoda commented Apr 18, 2021

npm run dev

[email protected] dev [project-path]-routify
run-p routify nollup

[email protected] nollup [project-path]-routify
nollup -c

[email protected] routify [project-path]-routify
routify

internal/validators.js:125
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^


Seems '../.routify/routes' doesnt exist...but, If I change 'import { routes } from "../.routify/routes";' to 'import { routes } from "@roxi/routify/tmp/routes";' in App.svelte then the error just errs out on nollup -c

@archoda archoda changed the title Running 'npx @roxi/routify init' returns error throw new ERR_INVALID_ARG_TYPE(name, 'string', value); Apr 18, 2021
@ghostdevv
Copy link
Member

Not sure why this is, can you use npx stackmix instead? that is our new beta template system

@archoda
Copy link
Author

archoda commented Apr 19, 2021

Unfortunately, I cannot if it's still only in beta.

@jakobrosenberg
Copy link
Member

Just to be clear, stackmix is beta, but the packages it uses aren't. If you're able to generate a working template that fits your needs, you should be good.

@ghostdevv
Copy link
Member

What Jake said, the tool is still in beta but the templates aren't

@ghostdevv
Copy link
Member

Is this still an issue? @archoda

@tobbtechnologies
Copy link

I face the same problem npm run dev fails

[email protected] nollup
nollup -c

path.js:39
throw new ERR_INVALID_ARG_TYPE('path', 'string', path);
^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Re
ceived type undefined
at assertPath (path.js:39:11)
at resolve (path.js:166:7)
at _getParentModuleDir (C:\Users\Tobb\svelte\node_modules\configent\configen
t.js:176:24)
at C:\Users\Tobb\svelte\node_modules\configent\configent.js:161:46
at getDetectDefaults (C:\Users\Tobb\svelte\node_modules\configent\configent.
js:114:65)
at buildConfig (C:\Users\Tobb\svelte\node_modules\configent\configent.js:64:
41)
at configent (C:\Users\Tobb\svelte\node_modules\configent\configent.js:56:12
)
at module.exports.input (C:\Users\Tobb\svelte\node_modules@roxi\routify\lib
\utils\config.js:7:40)
at Object. (C:\Users\Tobb\svelte\node_modules@roxi\routify\plugi
ns\cli.js:5:48)
at Module._compile (internal/modules/cjs/loader.js:689:30)
ERROR: "routify" exited with 1.

@ghostdevv
Copy link
Member

Can you try using stackmix

@tobbtechnologies
Copy link

Thank you for your reply

this

$ git clone https://github.com/roxiness/stackmix.git
$ cd routify-templates
$ npm install

from here https://www.npmjs.com/package/stackmix

is not working too

@alesvaupotic
Copy link
Contributor

Use it like npx stackmix and then choose your prefered stack

image

@tobbtechnologies
Copy link

Thanks a lot for your help but it is not working

C:\Users\Tobb>cd demo

C:\Users\Tobb\demo>npx stackmix
(node:2956) ExperimentalWarning: The fs.promises API is experimental
C:\Users\Tobb\node_modules\canvasit\lib\blueprint\hookHelpers.js:31
fileWalker = callback => fileWalker(this.output, callback)
^

SyntaxError: Unexpected token =
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)

C:\Users\Tobb\demo>npm i stackmix
(node:3852) ExperimentalWarning: The fs.promises API is experimental
npm WARN EBADENGINE Unsupported engine { package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=12' },
npm WARN EBADENGINE current: { node: 'v10.15.1', npm: '7.8.0' } }

changed 10 packages, and audited 267 packages in 2m

12 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

C:\Users\Tobb\demo>npx stackmix
(node:116) ExperimentalWarning: The fs.promises API is experimental
C:\Users\Tobb\node_modules\canvasit\lib\blueprint\hookHelpers.js:31
fileWalker = callback => fileWalker(this.output, callback)
^

SyntaxError: Unexpected token =
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)

C:\Users\Tobb\demo>

@alesvaupotic
Copy link
Contributor

What's your node version?

npm WARN EBADENGINE required: { node: '>=12' },
npm WARN EBADENGINE current: { node: 'v10.15.1', npm: '7.8.0' } }

@tobbtechnologies
Copy link

This one v10.15.1

Everything about svelte works except this nice router part, I cannot update node version it is giving problems. I am able to do all I want with this version except this routify.

I reada "Given the variety of fragments, we would greatly appreciate contributors for this projects pray", but there is no clear communication on how we should do it.

There is no contact us, no emails except to use this issues.

There is typo error here

$ git clone https://github.com/roxiness/stackmix.git
$ cd routify-templates
$ npm install

clone creates stackmix and cd routify-templates is moving to a non existent directory.

I fell in love with svelte and routify but if I can help where I can, I am willing to do so.

@alesvaupotic
Copy link
Contributor

I am not sure how this will play out as Node 10 is out-of-life today exactly.

README is getting an update, thanks for reporting.

@ghostdevv
Copy link
Member

@tobbtechnologies Install nvm on your relevant system and then you can do
nvm install 14 --lts
nvm use <version> where is the version you just installed (it will say something like 14.xx.xx)

You need node 12 and above

@jakobrosenberg
Copy link
Member

There's also Volta if nvm isn't an option.

@braebo
Copy link
Member

braebo commented May 8, 2021

I've been getting this same issue when using stackmix with vite for dev and spank + rollup -c for build. Anytime rollup -c or rollup -cw is run, the error throws.

[!] TypeError: The "path" argument must be of type string. Received an instance of Object
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Object
    at new NodeError (node:internal/errors:329:5)
    at validateString (node:internal/validators:129:11)
    at resolve (node:path:1019:7)
    at Object.<anonymous> (/Users/fractal/dev/Commissions/DelaneyDesign/rollup.config.js:77:5)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.require.extensions.<computed> [as .js] (/Users/fractal/dev/Commissions/DelaneyDesign/node_modules/.pnpm/rollup@2.47.0/node_modules/rollup/dist/shared/loadConfigFile.js:530:20)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)

I wonder if it's coming from here:
Screenshot 2021-05-07 at 10 36 21 PM

Seems to be unaffected by the node version.

Is resolve supposed to be the @rollup/plugin-node-resolve plugin or path.resolve?

@jakobrosenberg
Copy link
Member

@fractalhq it seems that resolve was changed to accept strings instead of objects. Can you check which version of resolve is used?

@jakobrosenberg
Copy link
Member

Maybe try dedupe: ['svelte'] instead of the callback.

@braebo
Copy link
Member

braebo commented May 8, 2021

Doesn't seem to make a difference. These issues for svelte#6159 and svelte#339 points to svelte-preprocess and the filename option not getting the right path.

@jakobrosenberg
Copy link
Member

I think you're right. Any idea how to solve it?

@jakobrosenberg jakobrosenberg reopened this May 8, 2021
@braebo
Copy link
Member

braebo commented May 8, 2021

It's quite the rabbit hole. Might be this bug in globby#145. A lot of people seem to have worked around it by moving commonjs() to the top of the plugins list according to rollup#3939, but that doesn't seem to help here.

@ghostdevv
Copy link
Member

This should be fixed, tag me if not

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

6 participants