stealjs / steal

Gets JavaScript
https://stealjs.com
MIT License
1.37k stars 521 forks source link

The module [@feathersjs/socketio/lib/lib] couldn't be fetched. #1444

Open leoj3n opened 6 years ago

leoj3n commented 6 years ago
GET http://localhost:8080/node_modules/@feathersjs/socketio/lib/lib.js 404 (Not Found)

GET http://localhost:8080/node_modules/@feathersjs/socketio/lib/lib/index.js 404 (Not Found)

Error: 404 Not Found: http://localhost:8080/node_modules/@feathersjs/socketio/lib/lib.js

The module [@feathersjs/socketio/lib/lib] couldn't be fetched.
Clicking the link in the stack trace below takes you to the import.
See https://stealjs.com/docs/StealJS.error-messages.html#404-not-found for more information.

  1 | import $ from 'jquery';
> 2 | import socketio from '@feathersjs/socketio';
    |                     ^
  3 | $(document.body).append("<h1>Hello World!</h1>");
  4 | 

    at (index.js:2)

image

$ ls node_modules/\@feathersjs/socketio/lib/
index.js

$ cat node_modules/\@feathersjs/socketio/package.json | grep main
  "main": "lib/",

{
  "name": "steal-at-import-broken",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "steal": {
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "steal": "github:stealjs/steal#major",
    "steal-tools": "github:stealjs/steal-tools#major"
  },
  "dependencies": {
    "jquery": "^3.3.1",
    "@feathersjs/socketio": "^3.2.2"
  }
}
import $ from 'jquery';
import socketio from '@feathersjs/socketio';
$(document.body).append("<h1>Hello World!</h1>");
<!doctype html>
<html>
  <body>
    <script src="./node_modules/steal/steal.js" main="index"></script>
  </body>
</html>

$ cat node_modules/\@feathersjs/socketio/package.json | grep main
  "main": "lib/index.js",

image


Why is possible to import jquery, but not @feathersjs/socketio?

matthewp commented 6 years ago

Thanks for reporting. I'll add it to the list.

leoj3n commented 6 years ago

Looks like @feathersjs/socketio is meant for server-side. Using @feathersjs/socketio-client results in no error. https://docs.feathersjs.com/migrating.html#client-side-feathers

I'm not sure if steal should have been able to resolve the path regardless, or if steal could have detected this user error and given a helpful warning, so I won't close this issue myself.