typescript-rest icon indicating copy to clipboard operation
typescript-rest copied to clipboard

Doesn't play nice with Webpack

Open user1m opened this issue 7 years ago • 2 comments

Dev version (non-webpacked) works great but when I build a Prod version w/ webpack I keep getting Error: Duplicated declaration for path [/users/cleaners/all], method [1].. There is only 1 path defined as such so unclear why this is the resulting error.

Stack:

/workdir/app/webpack:/node_modules/typescript-rest/dist/server-container.js:539
            throw Error("Duplicated declaration for path [" + resolvedPath + "], method [" + serviceMethod.httpMethod + "].");
^
Error: Duplicated declaration for path [/users/cleaners/all], method [1].
    at Function.Error [as resolvePath] (/workdir/app/webpack:/node_modules/typescript-rest/dist/server-container.js:539:1)
    at Function.resolvePath [as resolveProperties] (/workdir/app/webpack:/node_modules/typescript-rest/dist/server-container.js:521:1)
    at e.resolveProperties [as buildService] (/workdir/app/webpack:/node_modules/typescript-rest/dist/server-container.js:156:1)
    at buildService (/workdir/app/webpack:/node_modules/typescript-rest/dist/server-container.js:111:1)
    at Map.forEach (<anonymous>)
    at forEach (/workdir/app/webpack:/node_modules/typescript-rest/dist/server-container.js:109:1)
    at Map.forEach (<anonymous>)
    at e.forEach [as buildServices] (/workdir/app/webpack:/node_modules/typescript-rest/dist/server-container.js:107:1)
    at Function.buildServices (/workdir/app/webpack:/node_modules/typescript-rest/dist/server.js:24:1)
    at Object.buildServices (/workdir/app/webpack:/release/lib/index.js:32:1)
    at call (/workdir/app/webpack:/webpack/bootstrap:19:1)
    at __webpack_require__ (/workdir/app/webpack:/webpack/bootstrap:83:1)
    at Object.<anonymous> (/workdir/app/webpack:/webpack/bootstrap:83:1)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)

user1m avatar Sep 26 '18 17:09 user1m

@thiagobustamante any advice on typescript-rest + webpack?

user1m avatar Sep 26 '18 18:09 user1m

Ended up being some webpack config issues....

EDIT: I was wrong. I keep running into random errors. The errors with webpack keep changing. Now I can't ping routes when I use to be able to.

user1m avatar Sep 26 '18 22:09 user1m