question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Isomorphic supported ?

See original GitHub issue

Hi, Really love what you done here that why I would like to use it both client and server in isomorphic way

Anyway there are some issues warning report from Webpack bundle cause by importing module

WARNING in ./~/typedjson/js/index.js Critical dependencies: 25:24-31 require function is used in a way in which dependencies cannot be statically extracted @ ./~/typedjson/js/index.js 25:24-31

WARNING in ./~/typedjson/js/index.d.ts Module parse failed: C:\Users\U6038377\Documents\ReadAround.me-Isomorphic\node_modules\typedjson\js\index.d.ts The keywo rd ‘interface’ is reserved (23:0) You may need an appropriate loader to handle this file type. SyntaxError: The keyword ‘interface’ is reserved (23:0)

so I need to do a tricky module import like this to remove all warning and error from both side

if (process.env.BROWSER) { // wepback 
    JsonObject = require('typedjson/src/typed-json.ts').JsonObject;
    JsonMember = require('typedjson/src/typed-json.ts').JsonMember;
}else { // Node with ts-node/register 
    JsonObject = require('typedjson').JsonObject;
    JsonMember = require('typedjson').JsonMember;
}

Any idea for this problem ?

Thank for help !

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
zapkubcommented, Jul 14, 2016

@JohnWhiteTB

Thanks for response! I just found way to fix this issues !!

for any Webpack build stream it need to exclude importing unnecessary files from bundling by adding External options like this

 output: {
    path: path.join(__dirname, 'dist'),
    libraryTarget: 'commonjs',
    filename: 'bundle.js'
  },
  resolve: {
    modulesDirectories: ['src/client', 'node_modules', 'shared'],
    extensions: ['', '.js', '.jsx', 'tsx', 'ts', 'scss']
  },
  externals: [
      /^(?!\.|\/).+/i,
  ],
1reaction
inad9300commented, Sep 29, 2016

I’m still seeing this warning. I have tried to configure webpack and TypeScript to work with CommonJS as suggested, but that didn’t seem to help. Any other idea is appreciated.

There is one thing I don’t quite understand: why is webpack trying to load .../typedjson/js/index.d.ts at all? This should be something exclusively handled on the TypeScript side, shouldn’t it? (In typings.json I have "typedjson": "npm:typedjson" as a dependency.)

Edit: the issue seems to be reopened in https://github.com/JohnWhiteTB/TypedJSON/issues/32.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Everyone is Talking About Isomorphic / Universal ...
As a result of this interchangeability, the Node.js and JavaScript ecosystem supports a wide variety of isomorphic frameworks such as React.js, lazo.js, ...
Read more >
Is git fetch support 'ssh' protocol? · Issue #231 · isomorphic-git ...
Hi, As I'm using 'git fetch', it fail to go with 'ssh' protocol? Is 'ssh protocol' supported by isomorphic-git? If it's not, will...
Read more >
merge - isomorphic-git
Returns an object with a schema like this: type MergeResult = { oid?: string; // The SHA-1 object id that is now at...
Read more >
MobileStrategy | Isomorphic Software - SmartClient
The technology used for building desktop interfaces must support a usable mobile ... and maintain applications across all supported devices and platforms.
Read more >
Isomorphic MOFs functionalized by free-standing acylamide ...
... we demonstrate the catalysis capability of a series of isomorphic MOFs ... groups serving as self-supported catalysts for the CO2 cycloaddition reaction....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found