Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0] Object #<StorageService> has no method 'getTypes' #413

Closed
dchem opened this issue Jul 27, 2014 · 0 comments
Closed

[2.0] Object #<StorageService> has no method 'getTypes' #413

dchem opened this issue Jul 27, 2014 · 0 comments

Comments

@dchem
Copy link

dchem commented Jul 27, 2014

I'm trying to migrate the current code using loopback 1.x to use loopback 2.0, but I am getting the following error when I do 'slc run'

/home/dchem/workspace/tapp/node_modules/loopback/lib/registry.js:246
var connectorTypes = ds.connector && ds.connector.getTypes();
                                                        ^
TypeError: Object #<StorageService> has no method 'getTypes'
    at DataSource.ds.createModel (/home/dchem/workspace/tapp/node_modules/loopback/lib/registry.js:246:57)
    at Object.<anonymous> (/home/dchem/workspace/tapp/server.js:26:20)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Object.<anonymous> (/usr/local/lib/node_modules/strong-supervisor/bin/sl-run.js:30:19)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

I have the following code inside server.js

var ds = loopback.createDataSource({
    connector: require('loopback-component-storage'),
    provider: 'filesystem',
    root: path.join(__dirname, 'storage')
});

var container = ds.createModel('container');
app.model(container);

You can also replicate this by

yo loopback
// edit server.js to include what's suggested in loopback-component-storage
npm install loopback-component-storage --save
slc run .

Problem persists with loopback@2.0.1

Here's the printout of slc --version

strong-cli v2.6.2 (node v0.10.26)
node-inspector v0.7.4
strong-build v0.1.2
strong-deploy v0.1.1
strong-pm v0.1.4
strong-registry v1.1.0
strong-supervisor v0.3.0 (strong-agent v0.4.12, strong-cluster-control v0.5.0)
generator-loopback v1.1.2
loopback-sdk-angular-cli v1.1.4
@dchem dchem changed the title loopback-component-storage has no getTypes() when checked by register.js loopback-component-storage filesystem container has no getTypes() when checked by register.js Jul 27, 2014
@dchem dchem changed the title loopback-component-storage filesystem container has no getTypes() when checked by register.js [2.0] loopback-component-storage filesystem container has no getTypes() when checked by register.js Jul 27, 2014
@dchem dchem changed the title [2.0] loopback-component-storage filesystem container has no getTypes() when checked by register.js [2.0] loopback-component-storage filesystem container has no getTypes() when checked by registry.js Jul 27, 2014
@dchem dchem changed the title [2.0] loopback-component-storage filesystem container has no getTypes() when checked by registry.js [2.0] Object #<StorageService> has no method 'getTypes' Jul 27, 2014
shelbys added a commit to shelbys/loopback that referenced this issue Aug 5, 2014
* upstream/master: (105 commits)
  Expose Model.exists over HTTP HEAD
  Return data source for app.dataSource()
  Fix typo in README
  Integration test: referencesMany
  Integration test: embedsMany
  Fix jsdoc for remoteMethod()
  Map exists to HEAD for REST
  Bump version
  Fix strongloop#413
  Build the email verification url from app context
  Update test case to remove usage of deprecated express apis
  Bump version
  updated LB module diagram
  Update package.json
  Updates for 2.0
  Update module diagram again
  Update module diagram
  Emit a 'modelRemoted' event by app.model()
  Fix remoting types for related models
  Fix for email transports
  ...

Conflicts:
	lib/application.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant