question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When using slotValue I get TypeError: prop.split is not a function

See original GitHub issue

// Angular

    {
        option: "Angular Ngrx Store",
        defaultCase: '(pascalCase)',
        entry: {
            folderPath: './tools/templates/angular/ngrx-store/',
        },
        stringReplacers: [{slot:'__name__', slotValue: 'asdasdada'}, '__model__'],
        output: {
            path: './src/app/stores/__name__(lowerCase)',
            pathAndFileNameDefaultCase: '(kebabCase)',
        },
    },

√ What do you want to generate? · Angular Ngrx Store (node:19132) UnhandledPromiseRejectionWarning: TypeError: prop.split is not a function

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
codeBeltcommented, Apr 9, 2019

@Edhine check out my changes: https://github.com/codeBelt/generate-template-files/pull/24/files

Pull that branch down and do a yarn && yarn build. Then cd in to the examples folder and do yarn generate. If you look at the templates/angular/ngrx-store/__name__.reducer.spec.ts you can see I added

// Version: __version__(noCase)
// Description: __description__(noCase)

Here I am using data from the package.json file.

const config = require('../package.json');

generateTemplateFiles([
    // Angular
    {
        option: "Angular Ngrx Store",
        defaultCase: '(pascalCase)',
        entry: {
            folderPath: './tools/templates/angular/ngrx-store/',
        },
        stringReplacers: ['__name__', '__model__'],
        dynamicReplacers: [
            {slot:'__version__', slotValue: config.version},
            {slot:'__description__', slotValue: config.description}
        ],
        output: {
            path: './src/app/stores/__name__(lowerCase)',
            pathAndFileNameDefaultCase: '(kebabCase)',
        },
    }
]);

Let me know if this is what you wanted

0reactions
codeBeltcommented, Apr 10, 2019

@Edhine This feature is now in version 2.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: split is not a function in JavaScript | bobbyhadz
The "split is not a function" error occurs when we call the split() method on a value that is not of type string....
Read more >
What is causing the error `string.split is not a function`?
toString() returns the location in string form, so the concatenation will trigger that. You could also use document.URL to get a string. Share....
Read more >
[Solved] TypeError: split is not a function - ItsJavaScript
The TypeError: split is not a function occurs if we call a split() method on the value that is not of a type...
Read more >
How To Fix Split is Not a Function Error in JavaScript - Isotropic
The Solution. In most cases, the easiest thing you can do is simply make sure the variable you are working with is a...
Read more >
Create and Edit Custom Slot Types | Alexa Skills Kit
Custom slot types are used for lists of items that are not covered by ... slot types that you have added to your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found