feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
15.07k stars 751 forks source link

events is imported by node_modules/@feathersjs/feathers/lib/events.js, but could not be resolved #1679

Closed mylastore closed 4 years ago

mylastore commented 4 years ago

I am trying to set up the feathers client side with the code below but getting the error about. Node v10.16.3 Using sveltejs/sapper on client

import feathers from '@feathersjs/feathers';
import socketio from '@feathersjs/socketio-client';
import io from 'socket.io-client';
import auth from '@feathersjs/authentication-client';

const socket = io('http://localhost:3030', {
    transports: ['websocket'],
    forceNew: true
});
const client = feathers();

// Setup the transport (Rest, Socket, etc.) here
client.configure(socketio(socket));

// Available options are listed in the "Options" section
client.configure(auth({
    storage: window.localStorage
}));

export default client;
daffl commented 4 years ago

Hi there! We are happy to help but we need more information about your problem.

Error message

Are you getting an error message?

Steps to reproduce

The best way to get help is to share a GitHub repository or code snippet with the minimal setup to reproduce your issue.

(First please check that this issue is not already solved as described here)

Expected behavior

Tell us what should happen

Actual behavior

Tell us what happens instead

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working):

NodeJS version:

Operating System:

Browser Version:

React Native Version:

Module Loader:

mylastore commented 4 years ago

I am user sapper/svelte for client node v 10.16.3 I am getting this error on the chrome developers console. All I am doing is importing the feathers client startup code into my sapper start up js file witch is call client.js and get those errors below.

This error on google console

Uncaught TypeError: Failed to resolve module specifier "events". Relative references must start with either "/", "./", or "../".

I get this on the terminal

'events' is imported by node_modules/@feathersjs/feathers/lib/events.js, but could not be resolved – treating it as an external dependency 'events' is imported by commonjs-external-events, but could not be resolved – treating it as an external dependency

daffl commented 4 years ago

events is marked as a dependency of @feathersjs/feathers in its package.json. If it can't be resolved it is probably some misconfiguration with your package manager.