Description:
Whenever the cache-requests behavior of can-connect ends up in a Webpack bundle compiled in production mode, a runtime error void(0) is not a function results.
This boils down to a problem where the validate() function is not imported in production builds, but its use was accidentally left outside of the process.env guard.
Set up any solution with CanJS 5 and the master can package with webpack
import any can-connect related dependency from the can package which ends up transitively including can-connect/cache-requests/cache-requests.js. E.g. restModel will do.
How often can you reproduce it?
Description: Whenever the
cache-requests
behavior ofcan-connect
ends up in a Webpack bundle compiled in production mode, a runtime errorvoid(0) is not a function
results.This boils down to a problem where the
validate()
function is not imported in production builds, but its use was accidentally left outside of theprocess.env
guard.For CanJS 6 and
can-connect
4+ this was fixed in commit https://github.com/canjs/can-connect/commit/6494daa0e6cc27fa2262013e3a1327a15f20832aSteps to reproduce:
can
package with webpackimport
anycan-connect
related dependency from thecan
package which ends up transitively includingcan-connect/cache-requests/cache-requests.js
. E.g.restModel
will do.Expected results: No error is thrown,
Actual results: Error is thrown.
Environment: