English 中文(简体)
为什么这种错误在试图从另一卷纸面中进口一流?
原标题:Why is this error showing when trying to import a constant from another file in typescript?

I am trying to import a constant which is a JSON body from a file inside another folder inside my project. I have tried copying the relative path to it and the constant has the export keyword before the declaration so I have export constant = {}

在主要档案中,我发现Cannot有模块错误,我没有想法,因为我试图寻找可能的解决办法。

The files skeleton


**The import statement: **

import {post_next_questions_request_body} from  ..post-calls-bodies/post-next-questions ; 

错误:

Cannot find module  ..post-calls-bodies/post-next-questions  or its corresponding type declarations.

I have tried the following paths: ..post-calls-bodies/post-next-questions .post-calls-bodies/post-next-questions post-calls-bodies/post-next-questions

没有成功

最佳回答

页: 1 我知道我很抱歉,但提供这种文字解释会使人们更容易回答问题,因为我不得不在另一个表格中作一个情况来了解你的问题。 盲人看不到这一画面,我们大家可以从中复制和贴出文字。

不管怎么说,你对相对路径的辛醇是错的(在<条码>后需要一刀切的。”

而且,如果我最初的假设正确,道路本身是错误的:你需要达到两个层次。 翻一番后,将登在<条码>测试夹中(在<条码>外加试验。 再一次走下去,将允许你在<条码>后停机。 最后,你们需要:

import { post_next_questions_request_body } from  ../../post-call-bodies/post-next-questions ;

P.S.:如果你没有很好的理由,请设一个文件夹,在我的经验中不是最好的。 我的两人均是白色空间。 它在如此多的文字和方案中产生了麻烦,如果你真的不需要,那么像APIC 或(甚至更好)Api_tests 这样的东西会更有力。

问题回答

您是否适当进口或应当进口

 import {post_next_questions_request_body} from  ../post-calls-bodies/post-next-questions ; 

确保道路正确。





相关问题
Oracle: how to disable table compression on dmp file import

I have dmp file that was created by EXP utility. The source database has table compression enabled. How can I disable compression while importing dmp file. The destination database does not have ...

import feedparser works via SSH, but fails when in browser

I installed feedparser via SSH, using $ python setup.py install --home=~/httpdocs/python-libraries/feedparser-4.1/ I did that because I don t seem to have permission to properly run python setup.py ...

How to import existing ROR project?

I m new to Ruby on Rails (PHP developer here) and I need to edit an existing ROR project. I ve been using Aptana Studio for my PHP projects (switched to Zend after Aptana 2.0) but I ve kept Aptana ...

Circular #import/@class problem in ObjectiveC

I m going to use an example to properly illustrate my confusion. I can t quite wrap my head around this. In Cocoa touch, we have UIViewController and its subclass, UINavigationController. Now, UIVC ...

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...

热门标签