deep-foundation / deepcase-app

https://deep-foundation.github.io/deepcase-app/
The Unlicense
11 stars 6 forks source link

Problem with import of client-handler.tsx from deeplinks in deepcase via webpack in deepcase-app #237

Closed Konard closed 8 months ago

Konard commented 8 months ago

Looks like the problem is in this line of code:

https://github.com/deep-foundation/deepcase/blob/448790e73f5606500ede1106230dfc76c074e404/imports/client-handler.tsx#L5

Here is the log from terminal:

[0] error - ../deeplinks/imports/client-handler.tsx
[0] Module parse failed: Unexpected token (8:1)
[0] You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
[0] |   deep,
[0] |   input = {},
[0] > }: {
[0] |   value: string;
[0] |   deep: DeepClient;
[0] 
[0] Import trace for requested module:
[0] ../deeplinks/imports/client-handler.tsx
[0] ../deepcase/imports/client-handler.js
[0] ../deepcase/imports/cyto-handler.js
[0] ../deepcase/imports/cyto/graph.js

We recently added packages/deeplinks as workspace, may be the issue is connected to:

https://github.com/deep-foundation/dev/blob/a785aa4be7c71d822ac114a743cdb592e4c9746a/package.json#L116

For some reason, webpack tries to import tsx file instead of its js version.

Konard commented 8 months ago

Solution:

https://github.com/deep-foundation/deepcase-app/commit/f44921b5b1a7e5ffe553b8a4ec4ccbe66f155d52#diff-882b2c04b01b2e8b2cdcf1817c30ea503a8005f1c0d54cfff37053b6801fea85R44-R48

    // Exclude .tsx files
    config.module.rules.push({
      test: /\.tsx$/,
      use: [],
    });
FreePhoenix888 commented 8 months ago

Sweep: retry