Coder Social home page Coder Social logo

Typings about class-transformer HOT 10 CLOSED

typestack avatar typestack commented on May 16, 2024
Typings

from class-transformer.

Comments (10)

pleerock avatar pleerock commented on May 16, 2024

Hello,
may I confirm something: do you use angular.beta6 project with typings or you are doing something else?
at the moment because of this issue you cannot add serializer as a dependency into your typings.json, so you need manually add to your typings.json all ambient dependencies from serializer.ts (this is only es6-shim, and if you are using angular - it means you already have es6-shim in your ambient dependencies and you dont need to do anything)
Did you try to start using library despite the fact that typings install does not install anything new for you?

from class-transformer.

wozniakm avatar wozniakm commented on May 16, 2024

Yes, I'm using the same Angular 2.0.0-beta.6 with typings. I also have es6-shim in my ambient dependencies. The problem is that when I try to import serializer.ts to any file in my project, typescript is throwing an error that serializer.ts can not be found, but serializer.ts directory is present in node modules directory. Any ideas?

from class-transformer.

pleerock avatar pleerock commented on May 16, 2024

can you provide a code snippet how do you import it? Also do you use "moduleResolution": "node" in your tsconfig?

from class-transformer.

wozniakm avatar wozniakm commented on May 16, 2024

I was trying to import it as you suggested in readme, but it was throwing an error that can not resolve file. Below is the snippet:

import {serialize} from "serializer.ts";

It started to work when I changed that into:

import {serialize} from 'serializer.ts/serializer';

It's now showing warnings that can not find source files and indeed they are not present in module directory.

from class-transformer.

pleerock avatar pleerock commented on May 16, 2024

thats strange, I just created a test project and installed it from scratch - everything looks working. If you can attach or send me your test project I'll take a look on that

from class-transformer.

wozniakm avatar wozniakm commented on May 16, 2024

I am using https://github.com/angularclass/angular2-webpack-starter as a base and would really appreciate if you can take a look on this.

from class-transformer.

pleerock avatar pleerock commented on May 16, 2024

sorry that was an error in docs. in readme only "example with angular" had correct example. you should use import {serialize} from "serializer.ts/Serializer";

import {serialize} from 'serializer.ts/serializer';
It's now showing warnings that can not find source files and indeed they are not present in module directory.

maybe its because you have imported serializer.ts/serializer instead of serializer.ts/Serializer ?

from class-transformer.

wozniakm avatar wozniakm commented on May 16, 2024

It is working fine now, the warnings disappeared spontaneously. For someone who is starting with TypeScript, like me, that might be serious problem. Thanks for help :)

from class-transformer.

pleerock avatar pleerock commented on May 16, 2024

yw, dont forget to star a project :D

from class-transformer.

github-actions avatar github-actions commented on May 16, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from class-transformer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.