How to import utils

11 views
Skip to first unread message

Harika Gunti

unread,
Sep 27, 2019, 1:56:59 PM9/27/19
to Angular and AngularJS discussion
Hi All, I am unable to import

import * as utils from "utils/utils";

It is giving below error for my angular mobile application

Cannot find module 'utils/utils'

Sander Elias

unread,
Oct 3, 2019, 2:00:23 AM10/3/19
to Angular and AngularJS discussion

Hi Harika,

if you want to import something from your own app, it needs a relative path to the file. If you don’t start the import with a . the tooling will look for it in node_modules

I suspect you need something like

import * as utils from "../utils/utils";

Regards
Sander

Reply all
Reply to author
Forward
0 new messages