Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Feathers writing in typescript fails to boot on configuration #47

Closed
koenverburg opened this issue Sep 2, 2017 · 2 comments
Closed

Comments

@koenverburg
Copy link

Where it fails

I'm writing feathers in typescript but it fails on configuration so it won't boot.
Also, I can't find any information about writing feathers in typescript or es6 so I think I'm on my own here. I just gonna follow the steps that I have for Express.

image

Expected behavior

That the app boots

Actual behavior

It fails to boot

System configuration

just a normal laptop

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

    "debug": "^2.6.8",
    "express": "^4.15.3",
    "feathers": "^2.1.7",
    **"feathers-configuration": "^0.4.1",**
    "feathers-errors": "^2.9.1",
    "feathers-hooks": "^2.0.2",
    "feathers-hooks-common": "^3.7.2",
    "feathers-knex": "^2.7.2",
    "feathers-objection": "^0.6.0",
    "feathers-rest": "^1.8.0",
    "feathers-sequelize": "^2.3.0",
    "feathers-socketio": "^2.0.0",

NodeJS version:
node 8.4.0
npm 5.3.0
yarn 0.27.5

Operating System:
windows 10

Module Loader:

import fs from 'fs';
import path from 'path';
import webpack from 'webpack';
import NodemonPlugin from 'nodemon-webpack-plugin';
import WebpackNotifierPlugin from 'webpack-notifier';

let nodeModules = {};
fs.readdirSync('node_modules')
  .filter(function(x) {
    return ['.bin'].indexOf(x) === -1;
  })
  .forEach(function(mod) {
    nodeModules[mod] = 'commonjs ' + mod;
  });


let webpackConfig = {
	target: 'node',
  entry: `./server/index.ts`,
  output: {
		path: (process.env.NODE_ENV === 'production') ? path.join(__dirname, 'dist') : path.join(__dirname, 'bin'),
		libraryTarget: 'commonjs',
    filename: 'server.js'
	},
	externals: nodeModules,
  resolve: {
		extensions: ['.ts']
	},
  module: {
    rules: [
      { test: /\.json$/, use: 'json-loader' },
      { test: /\.tsx?$/, use: 'awesome-typescript-loader?configFileName=./tsconfig.server.json', exclude: /(node_modules|bower_components)/ }
    ]
	},
  plugins: [
    new webpack.SourceMapDevToolPlugin(),
		new NodemonPlugin()
  ]
};

export default webpackConfig;
@daffl
Copy link
Member

daffl commented Sep 7, 2017

Not sure if this has something to do with TypeScript? It looks like app.configure() did not get passed a function. Do you have a full stack trace?

@koenverburg
Copy link
Author

Never mind, had to create the database with Knex before I boot feathers.

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

No branches or pull requests

2 participants