Skip to content
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

sp-dev-fx-controls-react integration #28

Closed
russgove opened this issue May 17, 2021 · 11 comments
Closed

sp-dev-fx-controls-react integration #28

russgove opened this issue May 17, 2021 · 11 comments

Comments

@russgove
Copy link

Hi Sergei,
I'm trying to run fastserve on the sp-dev-fx-controls-react library and am getting this error (full output below). Any idea how to resolve it?
Russell Gove

npm run serve

@pnp/[email protected] serve C:\Users\trwg1\OneDrive - Tronox\sp-dev-fx-controls-react
gulp bundle --custom-serve --max_old_space_size=4096 && fast-serve

[10:50:36] Node flags detected: --max_old_space_size=4096
[10:50:36] Respawned to PID: 2780
Build target: DEBUG
[10:51:40] Using gulpfile ~\OneDrive - Tronox\sp-dev-fx-controls-react\gulpfile.js
[10:51:40] Starting 'bundle'...
[10:51:40] Starting gulp
[10:51:40] Starting subtask 'configure-sp-build-rig'...
[10:51:40] Finished subtask 'configure-sp-build-rig' after 50 ms
[10:51:40] Starting subtask 'pre-copy'...
[10:51:42] Finished subtask 'pre-copy' after 1.84 s
[10:51:42] Starting subtask 'copy-static-assets'...
[10:51:42] Starting subtask 'sass'...
[10:52:05] Finished subtask 'sass' after 23 s
[10:52:05] Starting subtask 'tsc'...
[10:52:16] [tsc] typescript version: 3.7.7
[10:52:16] Finished subtask 'copy-static-assets' after 34 s
[10:54:02] Finished subtask 'tsc' after 1.95 min
[10:54:02] Starting subtask 'save-webpack-config'...
[10:54:02] Finished subtask 'save-webpack-config' after 1.81 ms
[10:54:02] Starting subtask 'ensure-workbench'...
[10:54:02] Finished subtask 'ensure-workbench' after 141 ms
[10:54:02] Starting subtask 'post-copy'...
[10:54:02] Finished subtask 'post-copy' after 1.21 ms
[10:54:02] Starting subtask 'configure-webpack'...
[10:54:08] Finished subtask 'configure-webpack' after 5.74 s
[10:54:08] Starting subtask 'webpack'...
[10:55:25] Finished subtask 'webpack' after 1.27 min
[10:55:25] Finished 'bundle' after 3.73 min
[10:55:25] ==================[ Finished ]==================
[10:55:26] Project @pnp/spfx-controls-react version:3.1.0
[10:55:26] Build tools version:3.17.11
[10:55:26] Node version:v10.22.0
[10:55:26] Total duration:4.62 min
i 「wds」: Project is running at https://localhost:4321/
i 「wds」: webpack output is served from https://localhost:4321/dist/
i 「wds」: Content not from webpack is served from C:\Users\trwg1\OneDrive - Tronox\sp-dev-fx-controls-react
i 「wds」: 404s will fallback to /index.html
i 「wdm」: wait until bundle finished: /dist/controls-test-web-part.js
i 「wdm」: wait until bundle finished: /dist/ControlStrings_en-us.js
i 「wdm」: wait until bundle finished: /dist/ControlsTestWebPartStrings_en-us.js
i 「wdm」: wait until bundle finished: /dist/ootb-fields-field-customizer.js
i 「wdm」: wait until bundle finished: /dist/controls-test-web-part.js
i 「wdm」: wait until bundle finished: /dist/ControlStrings_en-us.js
i 「wdm」: wait until bundle finished: /dist/ControlsTestWebPartStrings_en-us.js
× 「wdm」: Time: 231572ms
Entrypoint controls-test-web-part = controls-test-web-part.js controls-test-web-part.js.map
Entrypoint ootb-fields-field-customizer = ootb-fields-field-customizer.js ootb-fields-field-customizer.js.map

ERROR in unable to locate 'C:/Users/trwg1/OneDrive - Tronox/sp-dev-fx-controls-react/src/loc/*.js' glob
i 「wdm」: Failed to compile.
No issues found.

@s-KaiNet
Copy link
Owner

Hi,
Yeah... that was in my list as well, it seems I will try it a bit earlier :)
Could you try running outside of the OneDrive folder just to make sure that this is not the reason why it fails.

@s-KaiNet
Copy link
Owner

The problem is that sp-dev-fx-controls-react uses TypeScript localization files instead of OOB .js. Thus we cannot "just run it" with fast-serve. Also, there are some TS errors related to styles export. So it's gonna be tricky.

@russgove
Copy link
Author

Thanks for the quick follow up! I fininished my work using gulp serve so there is no urgecy. W can close the issue if you like.

@russgove
Copy link
Author

You still want me to check if it works when not on my onedrive?

@s-KaiNet
Copy link
Owner

You still want me to check if it works when not on my onedrive?

No, thanks, it doesn't related to OneDrive.

@s-KaiNet
Copy link
Owner

I will leave this issue as opened, however, further investigation showed that TypeScript localization files inside sp-dev-fx-controls-react are the biggest problem and require additional efforts to add support to.

I'm still not sure whether it's a good idea to add this functionality to the core of fast-serve since TypeScript localization files is a bit of unusual use of SPFx. Probably the right answer is to implement an ad-hoc specifically for sp-dev-fx-controls-react. Before doing it, I should receive a kind of approval from sp-dev-fx-controls-react team that they need this feature, otherwise it will be just waste of time for me.

@s-KaiNet s-KaiNet changed the title ERROR in unable to locate 'C:/Users/trwg1/OneDrive - Tronox/sp-dev-fx-controls-react/src/loc/*.js' glob sp-dev-fx-controls-react integration May 18, 2021
@russgove
Copy link
Author

russgove commented May 18, 2021 via email

@s-KaiNet
Copy link
Owner

Nothing from sp-dev-fx-controls-react needs to be changed :)
The changes needed from fast-serve side, most likely a custom webpack plugin, which supports TypeScript based resource files. I definitely can work on it if there is an interest.

@russgove
Copy link
Author

russgove commented May 18, 2021 via email

@s-KaiNet
Copy link
Owner

Closing as the correspoinding PRs were added to the controls-react and property-controls.

The needed code is available in [email protected]

@russgove
Copy link
Author

Thankyoy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants