Skip to content

R.js - Path must be a string #231

@JohnRSim

Description

@JohnRSim

When optimising the css with r.js i'm getting the following error below?

sample module --

define(
    [
        'Action',
        'SPA_css!./adminPanel'
    ],
    function (Action) {

exampe config

{
                optimize: 'none',//'uglify',
				preserveLicenseComments: false,
                useStrict: true,
			    paths: {
					hgn: 				'../../lib/requirejs/hgn',
					hogan: 				'../../lib/requirejs/hogan',
	        		text: 				'../../lib/requirejs/text',
					Action:'empty:',
					//css:'empty',
					css: 			'empty:',
					normalize:'empty:',
					SPA_css: 			'../../lib/requirejs/css',
				},
				stubModules : ['text', 'hgn', 'hogan'],
				isBuild :true,
      			findNestedDependencies: true,
				inlineJSON:false,
				inlineText: false,
				optimizeCss: "standard.keepLines.keepWhitespace",
			    // configure hgn! plugin
			    hgn: {
			        templateExtension: '.mustache',
			        compilationOptions: {}
			    },
			    map: {
			        // '*' means all modules will get 'jquery-private'
			        // for their 'jquery' dependency.
			        //'*': { 'jquery': 'jquery-private' },

			        // 'jquery-private' wants the real jQuery module
			        // though. If this line was not here, there would
			        // be an unresolvable cyclic dependency.
			        //'jquery-private': { 'jquery': 'jquery' }

			        //used with https://github.com/guybedford/require-css to import spa skins
			        '*': {
			            'SPA_css': '../../lib/requirejs/css'
			        }
			    },
			    //urlArgs: { 'bust': Date.now() }, // disable on prod!.. enables cache on scripts. only needed if cache is enabled on browsers.
			    waitSeconds: 60,
			    xhtml: false
            };

Error

[15:11:54] Optimizing adminPanelTpl.js
TypeError: Path must be a string. Received [Function]
In module tree:
    adminPanelTpl
      ../../lib/requirejs/css


events.js:160
      throw er; // Unhandled 'error' event
      ^
 Error: TypeError: Path must be a string. Received [Function]
In module tree:
    adminPanelTpl
      ../../lib/requirejs/css

    at assertPath (path.js:7:11)

    at C:\work\git\nas\gulp\node_modules\requirejs\bin\r.js:26659:19
    at C:\work\git\nas\gulp\node_modules\requirejs\bin\r.js:3059:39
    at C:\work\git\nas\gulp\node_modules\requirejs\bin\r.js:2999:25
    at Function.prim.nextTick (C:\work\git\nas\gulp\node_modules\requirejs\bin\r.js:26410:9)
    at Object.p.errback (C:\work\git\nas\gulp\node_modules\requirejs\bin\r.js:2998:26)
    at Object.p.callback (C:\work\git\nas\gulp\node_modules\requirejs\bin\r.js:2984:23)
    at Object.p.promise.then (C:\work\git\nas\gulp\node_modules\requirejs\bin\r.js:3038:23)
    at build (C:\work\git\nas\gulp\node_modules\requirejs\bin\r.js:26616:12)
    at runBuild (C:\work\git\nas\gulp\node_modules\requirejs\bin\r.js:28624:17)
    at Object.context.execCb (C:\work\git\nas\gulp\node_modules\requirejs\bin\r.js:1946:33)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions