-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filename like "[id].fs" created with different path #1936
Comments
Hmm, probably the file name is not important here. This is just because fable-splitter is just flattening the folder structure so it doesn't reflect exactly the hierarchy of the original files. We did this originally to avoid path conflicts when compiling files coming from different hierarchies. @ncave I think you mentioned once that you had solved this problem for fable-compiler-js. Would it be possible to port the solution to fable-splitter? |
@alfonsogarciacaro It should be possible, it's all this calling that. We can easily add support in
This requires the exact version to be specified in the reference (technically even wildcards can be supported, at the cost of adding complexity). Of course, other package managers can be supported too, if we find a good mechanism to define that in the project file (but I'm not trying to reopen the package manager flame wars, so fnugget about it). |
So, can I help somehow? |
It'd be great if you could send a PR ti fix this @Neftedollar. This is the code in fable-splitter that decides the output path: Fable/src/fable-splitter/src/index.ts Lines 118 to 141 in bd3b30a
You can keep the folder structure by doing something like |
@alfonsogarciacaro ok, I'll take it. |
@alfonsogarciacaro how can I build it? fable-splitter git:(master) npm run build
> [email protected] build /Users/neftedollar/dev/fable/Fable/src/fable-splitter
> node build.js
exec /Users/neftedollar/dev/fable/Fable/node_modules/.bin/tsc
../../node_modules/typescript/lib/lib.es2015.iterable.d.ts(41,6): error TS2300: Duplicate identifier 'IteratorResult'.
node_modules/@types/node/index.d.ts(179,11): error TS2300: Duplicate identifier 'IteratorResult'.
Error: tsc failed with code 1
at runNpmBin (/Users/neftedollar/dev/fable/Fable/src/fable-splitter/build.js:23:15)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. what I'm doing wrong? |
@ncave @alfonsogarciacaro pls help #1936 (comment) |
@Neftedollar I'm not sure, normally building the splitter involves running |
@Neftedollar But if you're stuck, I can take a look at adding this functionality in |
@ncave thnx i'll try to build it from the root. thnx |
@ncave same story = / node_modules/typescript/lib/lib.es2015.iterable.d.ts:41:6 - error TS2300: Duplicate identifier 'IteratorResult'.
41 type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>;
~~~~~~~~~~~~~~
src/fable-splitter/node_modules/@types/node/index.d.ts:179:11
179 interface IteratorResult<T> { }
~~~~~~~~~~~~~~
'IteratorResult' was also declared here. can you build splitter now with current package-lock.json? here microsoft/TypeScript#32333 they said that we need just to update @type/node but nom update is not working for me (microsoft/TypeScript#32333 (comment)) and few days ago it comes back |
@Neftedollar Yes, it works for me (Node.js 12.x), and in CI. Perhaps the node/npm version that you're using is different, but that's probably not it. |
@ncave so, I've asked two coworkers run |
Would it be possible to check if this is still an issue when using Fable 3 instead of Fable 2 + splitter? |
@alfonsogarciacaro I'll check it this week |
@alfonsogarciacaro I've checked it! So we can close this issue. |
Awesome, thanks a lot for checking! |
Description
Hello!
I'm trying to use fable for next js
I'm using fable-splitter and fable-compiler packages.
There is a part of my App.fsproj
package.json
starting
npm run fableBuild
output part:
about.js
created near the about.fs./pages/about.js
And
[id].js
created with the path./post/[id].js
but expected./pages/post/[id].js
Why I need filenames like this
Repro code
https://github.com/Neftedollar/Nextjs-Fable-simple-app/tree/repro
Related information
The text was updated successfully, but these errors were encountered: