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.

Can't resolve ControlStrings

See original GitHub issue

Hi There,

I’ve been using spfx-controls-react just fine. However, now when attempting to add a ListView component I get the following error.

ERROR in ./node_modules/@pnp/spfx-controls-react/lib/controls/listView/ListView.js Module not found: Error: Can’t resolve ‘ControlStrings’ in ‘C:\Users\Studio\Developer\SharePoint\SPForm\node_modules@pnp\spfx-controls-react\lib\controls\listView’ @ ./node_modules/@pnp/spfx-controls-react/lib/controls/listView/ListView.js 18:14-39 @ ./node_modules/@pnp/spfx-controls-react/lib/controls/listView/index.js @ ./node_modules/@pnp/spfx-controls-react/lib/ListView.js @ ./src/scripts/components/list/List.tsx @ ./src/scripts/components/form/TabTwo.tsx @ ./src/scripts/components/layout/Form.tsx @ ./src/scripts/root.tsx @ ./src/scripts/index.ts @ multi ./node_modules/sp-build-tasks/dist/webpack/polyfills.js ./src/scripts/index.ts

ERROR in ./node_modules/@microsoft/sp-core-library/lib/SPCoreLibraryStrings.resx.js
Module not found: Error: Can't resolve 'resx-strings' in 'C:\Users\Studio\Developer\SharePoint\SPForm\node_modules\@microsoft\sp-core-library\lib'
 @ ./node_modules/@microsoft/sp-core-library/lib/SPCoreLibraryStrings.resx.js 4:4-27
 @ ./node_modules/@microsoft/sp-core-library/lib/SPError.js
 @ ./node_modules/@microsoft/sp-core-library/lib/index.js
 @ ./node_modules/@pnp/spfx-controls-react/lib/common/telemetry/index.js
 @ ./node_modules/@pnp/spfx-controls-react/lib/controls/listView/ListView.js
 @ ./node_modules/@pnp/spfx-controls-react/lib/controls/listView/index.js
 @ ./node_modules/@pnp/spfx-controls-react/lib/ListView.js
 @ ./src/scripts/components/list/List.tsx
 @ ./src/scripts/components/form/TabTwo.tsx
 @ ./src/scripts/components/layout/Form.tsx
 @ ./src/scripts/root.tsx
 @ ./src/scripts/index.ts
 @ multi ./node_modules/sp-build-tasks/dist/webpack/polyfills.js `./src/scripts/index.ts

app.json { "$schema": "../node_modules/sp-build-tasks/schema/v1/sppp.json", "spFolder": "_catalogs/masterpage/sppp-listform", "distFolder": "./dist", "localizedResources": { "ControlStrings": "../node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js" } }

tsconfig.json { "compilerOptions": { "target": "es5", "module": "esnext", "lib": ["es2017", "dom"], "rootDir": "src", "jsx": "react", "sourceMap": true, "declaration": true, "moduleResolution": "node", "noImplicitAny": false, "removeComments": true, "experimentalDecorators": true, "skipLibCheck": true, "types": ["node", "sharepoint"], "outDir": "tmp" }, "exclude": [ "node_modules", "webpack.config.js", "gulpfile.js", "build", "dist", "tmp", "cache" ] }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

2reactions
FreBoncommented, Jan 20, 2021

This is an old issue, but I got the same error when adding a PeoplePicker to my SPFx webpart. That was solved by just stopping the local server and re run “gulp serve”…

1reaction
AJIXuMuKcommented, Sep 11, 2018

sp-dev-fx-controls-react is developed to be used in SharePoint Framework solutions. generator-spreactformfields creates projects that are not SPFx solutions. So, I don’t think you can use it without some additional tricks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't resolve ControlStrings · Issue #124 - GitHub
Hi There, I've been using spfx-controls-react just fine. However, now when attempting to add a ListView component I get the following error.
Read more >
Error: Cannot find module 'ControlStrings' in SPFx Web Part
When you run your web part on Workbench or after deployment of web part, you can get the error: Cannot find module 'ControlStrings'....
Read more >
Error when compiling after importing into my solution the sp ...
Try running below commands on in your package: npm i @microsoft/sp-core-library npm i @microsoft/sp-dynamic-data npm i @microsoft/sp-page- ...
Read more >
Module not found: Error: Can't resolve in webpack.common.js
I could solve the issue by using resolve-url-loader module. It can help to somebody Below is part of webpack.js
Read more >
Export PnP reusable controls from SPFx library component
Original error: Cannot find module 'ControlStrings' ... possibly following the steps you have outlined above my resolve, but no such luck!
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