grant contrib connect is not supported since version 0.11. X connect.static And
connect.directory
you should install serve static (load static files) and
serve index (load directory)
npm install --save-dev grunt-contrib-connect serve-static
Examples
var serveStatic = require('serve-static');
var serveIndex = require('serve-index');
grunt.initConfig({
connect: {
options: {
test: {
directory: 'somePath',
middleware: function(connect, options){
var _staticPath = path.resolve(options.directory);
return [serveStatic(_staticPath), serveIndex(_staticPath)]
}
}
}
}
})
Reference link
http://stackoverflow.com/questions/32961124/warning-connect-static-is-not-a-function-use-force-to-continue
Read More:
- Failed to import static file of vue3 static resource. There is no static folder
- TypeError: connection.connect is not a function
- error: invalid use of non-static member function
- [Qt] error: call to non-static member function without an object argument
- non-static variable this cannot be referenced from a static context
- Nuxt cannot find the static resource in static
- IOS warning – this block declaration is not a prototype
- php mysqli_ connect_ Error () and mysqli_ connect_ The difference of errno() function
- geom_ Warning message: sign function’s own error
- C ා programming encountered an object reference is required for the non-static field, method, or property error
- Syntax error: typeerror: this.getoptions is not a function an error is reported when the. SCSS file is imported globally
- Function definition is not allowed here
- Front end project runtime prompts syntax error: typeerror: token.type.endswith is not a function solution
- TypeError: this.getOptions is not a function
- (20210301 solved) can’t connect to HTTPS URL because the SSL module is not available
- A PHP Error was encountered Severity: Warning Message: mysqli::real_connect(): Headers and client
- JS error – typeerror: XXX is not a function
- Mongodb (version 3.2) create user error addUser is not a function
- Webpack error module build failed: typeerror: fileSystem.statSync is not a function
- NPM install error cb.apply is not a function