Protractor export error - using classes from another projectusing external module in protractor test - cannot use namespace as a typeRequire custom module with npm and typescriptImporting external module with ES6 syntax and absolute pathIs it possible to transpile local modules from node_module?Typescript 2 — using ES6 import & require?How to Properly Export and Import Modules in TypeScriptImport statement was not compiled if it was not used laterGot “TS2300: Duplicate identifier 'Account'” error after upgraded to Typescript 2.9.1LernaJS Typescript cannot find moduleTypeScript 2.9 resolveJsonModule throws exception on transpiled filesJest&supertest ApI testing returning TypeError: app.address is not a function

Why does the Sun have different day lengths, but not the gas giants?

Extract more than nine arguments that occur periodically in a sentence to use in macros in order to typset

How much character growth crosses the line into breaking the character

Limits and Infinite Integration by Parts

Quoting Keynes in a lecture

Hero deduces identity of a killer

Creepy dinosaur pc game identification

Need help understanding what a natural log transformation is actually doing and why specific transformations are required for linear regression

Can the US President recognize Israel’s sovereignty over the Golan Heights for the USA or does that need an act of Congress?

Recommended PCB layout understanding - ADM2572 datasheet

Are Captain Marvel's powers affected by Thanos' actions in Infinity War

Fear of getting stuck on one programming language / technology that is not used in my country

What does chmod -u do?

How to fade a semiplane defined by line?

Can a College of Swords bard use a Blade Flourish option on an opportunity attack provoked by their own Dissonant Whispers spell?

What if a revenant (monster) gains fire resistance?

How to hide some fields of struct in C?

How can I write humor as character trait?

I'm the sea and the sun

What exact color does ozone gas have?

Is there an injective, monotonically increasing, strictly concave function from the reals, to the reals?

Why does a simple loop result in ASYNC_NETWORK_IO waits?

How could a planet have erratic days?

Does malloc reserve more space while allocating memory?



Protractor export error - using classes from another project


using external module in protractor test - cannot use namespace as a typeRequire custom module with npm and typescriptImporting external module with ES6 syntax and absolute pathIs it possible to transpile local modules from node_module?Typescript 2 — using ES6 import & require?How to Properly Export and Import Modules in TypeScriptImport statement was not compiled if it was not used laterGot “TS2300: Duplicate identifier 'Account'” error after upgraded to Typescript 2.9.1LernaJS Typescript cannot find moduleTypeScript 2.9 resolveJsonModule throws exception on transpiled filesJest&supertest ApI testing returning TypeError: app.address is not a function













1















I am trying to split my project into two separate projects and then reuse files between them.



At run time I get the following error SyntaxError: Unexpected token export - export Helper from './src/xx/hepler’;




main project



class-that-uses-the-helper-class.ts



import Helper from ‘sub-project’;
// const Helper = require (‘sub-project’); also tried this


package.json



"devDependencies": 
"sub-project": "file:../../sub-project/e2e"




sub-project



app.ts



 export Helper from './src/xx/helper’;


helper.ts



export class Helper 




package.json



 "name": "sub-project",

"main": "app.ts"


tsconfig.json




"extends": "../tsconfig.json",
"compilerOptions":
"outDir": "lib",
"rootDir": ".",
"target": "es5",
"module": "commonjs",
"types": [
],











share|improve this question
























  • I think you need to use import Helper instead of export helper in your app.ts

    – DublinDev
    yesterday











  • If i change to import, i get Helper is declared but its value is never read in app.ts, and in main project test file sub-project/app has no exported member Helper.ts

    – user6086008
    yesterday












  • I'm not too familiar with Typescript so apologies if I'm missing something obvious but am I correct in assuming you are using some of the functionality exported by helper.ts in the files where it is imported?

    – DublinDev
    yesterday












  • yes, thats correct

    – user6086008
    yesterday











  • i seem to have solved the first error, by changing the import statement to use require: import Helper = require('sub-project') Asked a new question here about the next error: stackoverflow.com/questions/55297763/…

    – user6086008
    18 hours ago















1















I am trying to split my project into two separate projects and then reuse files between them.



At run time I get the following error SyntaxError: Unexpected token export - export Helper from './src/xx/hepler’;




main project



class-that-uses-the-helper-class.ts



import Helper from ‘sub-project’;
// const Helper = require (‘sub-project’); also tried this


package.json



"devDependencies": 
"sub-project": "file:../../sub-project/e2e"




sub-project



app.ts



 export Helper from './src/xx/helper’;


helper.ts



export class Helper 




package.json



 "name": "sub-project",

"main": "app.ts"


tsconfig.json




"extends": "../tsconfig.json",
"compilerOptions":
"outDir": "lib",
"rootDir": ".",
"target": "es5",
"module": "commonjs",
"types": [
],











share|improve this question
























  • I think you need to use import Helper instead of export helper in your app.ts

    – DublinDev
    yesterday











  • If i change to import, i get Helper is declared but its value is never read in app.ts, and in main project test file sub-project/app has no exported member Helper.ts

    – user6086008
    yesterday












  • I'm not too familiar with Typescript so apologies if I'm missing something obvious but am I correct in assuming you are using some of the functionality exported by helper.ts in the files where it is imported?

    – DublinDev
    yesterday












  • yes, thats correct

    – user6086008
    yesterday











  • i seem to have solved the first error, by changing the import statement to use require: import Helper = require('sub-project') Asked a new question here about the next error: stackoverflow.com/questions/55297763/…

    – user6086008
    18 hours ago













1












1








1








I am trying to split my project into two separate projects and then reuse files between them.



At run time I get the following error SyntaxError: Unexpected token export - export Helper from './src/xx/hepler’;




main project



class-that-uses-the-helper-class.ts



import Helper from ‘sub-project’;
// const Helper = require (‘sub-project’); also tried this


package.json



"devDependencies": 
"sub-project": "file:../../sub-project/e2e"




sub-project



app.ts



 export Helper from './src/xx/helper’;


helper.ts



export class Helper 




package.json



 "name": "sub-project",

"main": "app.ts"


tsconfig.json




"extends": "../tsconfig.json",
"compilerOptions":
"outDir": "lib",
"rootDir": ".",
"target": "es5",
"module": "commonjs",
"types": [
],











share|improve this question
















I am trying to split my project into two separate projects and then reuse files between them.



At run time I get the following error SyntaxError: Unexpected token export - export Helper from './src/xx/hepler’;




main project



class-that-uses-the-helper-class.ts



import Helper from ‘sub-project’;
// const Helper = require (‘sub-project’); also tried this


package.json



"devDependencies": 
"sub-project": "file:../../sub-project/e2e"




sub-project



app.ts



 export Helper from './src/xx/helper’;


helper.ts



export class Helper 




package.json



 "name": "sub-project",

"main": "app.ts"


tsconfig.json




"extends": "../tsconfig.json",
"compilerOptions":
"outDir": "lib",
"rootDir": ".",
"target": "es5",
"module": "commonjs",
"types": [
],








typescript protractor






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday







user6086008

















asked yesterday









user6086008user6086008

75210




75210












  • I think you need to use import Helper instead of export helper in your app.ts

    – DublinDev
    yesterday











  • If i change to import, i get Helper is declared but its value is never read in app.ts, and in main project test file sub-project/app has no exported member Helper.ts

    – user6086008
    yesterday












  • I'm not too familiar with Typescript so apologies if I'm missing something obvious but am I correct in assuming you are using some of the functionality exported by helper.ts in the files where it is imported?

    – DublinDev
    yesterday












  • yes, thats correct

    – user6086008
    yesterday











  • i seem to have solved the first error, by changing the import statement to use require: import Helper = require('sub-project') Asked a new question here about the next error: stackoverflow.com/questions/55297763/…

    – user6086008
    18 hours ago

















  • I think you need to use import Helper instead of export helper in your app.ts

    – DublinDev
    yesterday











  • If i change to import, i get Helper is declared but its value is never read in app.ts, and in main project test file sub-project/app has no exported member Helper.ts

    – user6086008
    yesterday












  • I'm not too familiar with Typescript so apologies if I'm missing something obvious but am I correct in assuming you are using some of the functionality exported by helper.ts in the files where it is imported?

    – DublinDev
    yesterday












  • yes, thats correct

    – user6086008
    yesterday











  • i seem to have solved the first error, by changing the import statement to use require: import Helper = require('sub-project') Asked a new question here about the next error: stackoverflow.com/questions/55297763/…

    – user6086008
    18 hours ago
















I think you need to use import Helper instead of export helper in your app.ts

– DublinDev
yesterday





I think you need to use import Helper instead of export helper in your app.ts

– DublinDev
yesterday













If i change to import, i get Helper is declared but its value is never read in app.ts, and in main project test file sub-project/app has no exported member Helper.ts

– user6086008
yesterday






If i change to import, i get Helper is declared but its value is never read in app.ts, and in main project test file sub-project/app has no exported member Helper.ts

– user6086008
yesterday














I'm not too familiar with Typescript so apologies if I'm missing something obvious but am I correct in assuming you are using some of the functionality exported by helper.ts in the files where it is imported?

– DublinDev
yesterday






I'm not too familiar with Typescript so apologies if I'm missing something obvious but am I correct in assuming you are using some of the functionality exported by helper.ts in the files where it is imported?

– DublinDev
yesterday














yes, thats correct

– user6086008
yesterday





yes, thats correct

– user6086008
yesterday













i seem to have solved the first error, by changing the import statement to use require: import Helper = require('sub-project') Asked a new question here about the next error: stackoverflow.com/questions/55297763/…

– user6086008
18 hours ago





i seem to have solved the first error, by changing the import statement to use require: import Helper = require('sub-project') Asked a new question here about the next error: stackoverflow.com/questions/55297763/…

– user6086008
18 hours ago












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55278249%2fprotractor-export-error-using-classes-from-another-project%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55278249%2fprotractor-export-error-using-classes-from-another-project%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript