Skip to content

Conversation

frank-dspeed
Copy link

Fixes usage inside Node when loaded via nodejs

(node:12721) ExperimentalWarning: The ESM module loader is experimental.
TypeError: Cannot read property 'href' of undefined
    at Object.<anonymous> (/home/frank/example-es6-loader/stealify-view/canjs/canjs-master/node_modules/can-ajax/dist/cjs/can-ajax.js:22:43)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    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:20:18)
    at Object.<anonymous> (/home/frank/example-es6-loader/stealify-view/canjs/canjs-master/node_modules/can-connect/data/url/url.js:98:12)
    at Module._compile (internal/modules/cjs/loader.js:689:30)

Fixes usage inside Node when loaded via nodejs
```js
(node:12721) ExperimentalWarning: The ESM module loader is experimental.
TypeError: Cannot read property 'href' of undefined
    at Object.<anonymous> (/home/frank/example-es6-loader/stealify-view/canjs/canjs-master/node_modules/can-ajax/dist/cjs/can-ajax.js:22:43)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    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:20:18)
    at Object.<anonymous> (/home/frank/example-es6-loader/stealify-view/canjs/canjs-master/node_modules/can-connect/data/url/url.js:98:12)
    at Module._compile (internal/modules/cjs/loader.js:689:30)


```
@frank-dspeed
Copy link
Author

This is needed to import the following Packages: can-connect, can-ajax, restModel, RealtimeRestModel,

@chasenlehara
Copy link
Member

@frank-dspeed Would you mind adding a test to show what this covers please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants